The root menu (the one activated by holding shift and hitting f3) does not disappear if you log out of a server.
To recreate, simply activate it in a server and log out (I don't know if it works for LAN if someone joins and then logs out).
Here is a link to a video tutorial:
https://www.youtube.com/watch?v=y-sRZ6YvvQc
Related issues
is duplicated by
Comments

Confirmed on realms as well.