Windows key is minimizing my game if it is maximized or fullscreen

If I maximize or set my game to fullscreen and then press the windows button my game minimizes. Should this happen? Because I would like to record the game with the xbox app and for this I need to open it ingame with “windows + G”. So I am not able to record maximized or in fullscreen.