Oh, I'm sorry, you wanted instantaneous user switching? That's a smidgen harder than the 40-year-old solutions :)
These OS have been able to run multiple concurrent user sessions for 40 years, and fast user switching has been a feature of all desktop OS since Windows 9x went the way of the dodo.
There are specific issues (core services of these systems are probably — sadly — coded with the idea that a single user is running), but nothing which should be hard to fix.
What about the memory overhead of concurrent sessions?
Who gets to run background processes, and when are they terminated? Because neither CPU nor battery life exist in abundance.
What happens to incoming calls/e-mails/texts/notifications? (Especially for the guest account, where you don't have a second phone number for that account)
What happens to e.g. alarms set by user1 if user2 is logged in?
Which settings are shared, which aren't? And if your phone storage is encrypted, how do you handle shared settings? What about privacy? Can user1 e.g. record GPS signals even if user2 is logged in? If not, what about "Find my phone" features?
Sure, conceptually it's a solved issue. Practically, there are innumerable details to be figured out.
E.g.
App1 has uid 100 User1 has uid 101 User2 has uid 102
If all userdata for App1 is owned by uid 100, User1 or User2 could potentially used App1 to gain access to the other user's app-specific user data.
(I'll admit that I'm not an iOS or Android programmer, so I may be a bit out of my depth here.)
On Android, uids are used for apps, not for users. Supporting multiple users on Android is thus not as simple as one might think.