When you loading into a world, and then unfocusing the game window (by opening start menu, clicking the taskbar, open another apps, etc), when the world is fully loaded the game didn't pause the game, instead it will continue to running in the background.
Steps to reproduce:
Open Minecraft/Minecraft Preview
Enter into any worlds
When the world is loading, unfocus the game window by clicking the taskbar
Wait until the game fully loaded the world
Expected results:
The game automatically open the pause screen and paused the game.
Observed results:
The game continue to running in the background.
Attachments
Comments 4

Also affects when the player sleeps. The game will put you into the sleeping screen but if the player unfocuses the window while the sleeping screen is open, the game will not be paused upon the player finishing sleeping and back into the world.
This also occurs when you're inside any containers or chat screen, if your game window is unfocused while in those screens, when you takes damages the game will resumes in the background.
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki