This only updates the front-end knowledge of the connected user (which can therefore be faked as you seem to do, but in the end it's still the API that checks for authorization). If you don't have custom back-end code to login into that guest or handle queries without authorization, you will likely see plenty of API errors whenever the front-end tries to do an action it thinks it can do but cannot. Also the front-end will probably don't receive any permission for that user, because that data is only included in the boot payload if the user is the current logged in user in the back-end.
I'm writing this here to make sure it doesn't confuse anybody mistaking it for any login/authorization call.
Regarding your question, could you explain why you need a guest user ? What should this achieve ? You want Flarum to always be connected to a single user that doesn't require authorization ?
You could edit the session manager to always have a default user that actually exists (instead of the virtual guest user of Flarum that doesn't). Maybe you'd need to also apply some special restrictions to that user to prevent it doing unwanted things.
Or are you just trying to boot the core Flarum in unconnected state ? Then the default payload should be fine.
I want to make sure you're aware Flarum's boot payload is dynamically created, and needs to be refreshed once connected. If you have to inject that into your own page that's not based on Flarum, you can get that payload by hitting the /api/forum endpoint, either from the front-end, or directly with an internal API call as Flarum does internally.
If you're integrating Flarum inside your app, and not your app inside Flarum via an extension. There's a real possibility for many things to break. There are discussions about other experiments on this forum you might find via the search that can come helpful.
Opening a modal is as simple as calling app.modal.show(new ModalClass). You can see it being used in https://github.com/flagrow/direct-links which I also happen to have made a video tutorial for (it's somewhere in resources). If you need to call the modals from outside of Flarum, you should be able to resolve.
In beta 7 if you need to call it from outside a Flarum extension, it would be System.get('flarum/app').default.modal.show(new (System.get('flarum/components/LogInModal').default)) for the login modal, and I can let you find (or guess) what it is for the sign up modal 😉