Answer from GrapheneOS account in another similar thread:
Switching users has always worked this way. It highly deprioritizes the background users and will unload their inactive apps to free memory for apps in the current user.
https://discuss.grapheneos.org/d/20034-regression-in-grapheneos-apps-are-aggressively-killed-by-os-in-the-background
Pavestone2734 I imagine this is not a bug but a feature, but still I wonder is there a way to stop this from happening?
One thing you can do is try to group apps that belong together in the same user profile. Such as all apps related to the real-life you (banking etc) in one profile, all apps related to your anonymous online identity in another, and so on. This is the best way to compartmentalize ones life anyway. Generally, if you login using the same email account or phone number in multiple apps, put those apps in the same user profile. They are linked to each other anyway. Keep them separate from apps where you login with a totally different email and that you don't want linked to your first email.
That way, you will have a secure compartmentalization of apps, yet, all your TOTP codes that belong to apps in one profile will also be in that profile.