Standalone game won't go in windowed mode

I’m trying to make settings for player to change from windowed mode to fullscreen mode, but when i launch in standalone game to test this it goes from windowed back to fullscreen instantly.


Here’s what i use to test