With all respect to xstate, if you don't need complex nested state machines, you should check out robot3.js. The automatic TS type inference makes it pretty handy for the spots where you want a bit of state machine logic.
But I think even there it’s possible to encounter platform-dependent bugs - starting from view issues (you know, different OS can use different browser engines) and up to those related to system APIs.
I once bought Paste (a clipboard manager for Mac). However, they later switched to a subscription model, and I decided not to make a new purchase. Then Raycast, which is free, came out, and I stopped using Paste altogether.