For a few days I have had the problem on my MacBook that as soon as I open Minecraft I can no longer switch sides. Likewise, I can no longer minimize the window. So if I want to use something else on my MacBook again, I have to close Minecraft. This problem only occurred a few days ago, before that I could switch back and forth as often as I wanted.
Do you play with mods With mods you always have problems, no matter where. Maybe you switched to full screen mode and switched to windowed mode. If everything doesn't work, reinstall Minecraft and try again, also no Apple products for gaming, maybe your laptop or whatever is simply overwhelmed and calculates too many patches and ways that overload your Whatever. If it still didn't work, just write to me and I'll help you further