PineappleEevee I'm not trying to be difficult here, but the obvious solution is to not close your laptop when you're playing. This is bad for the performance of demanding games and always has been. The fact that it works some of the time is more of a reflection of how the OS and games have become more flexible, but it's never been perfect.
If you want to walk away from the game and laptop for a while, put Sims 4 into windowed mode, then minimize it. The laptop should turn off the screen sooner or later. If that's not good enough, you can try closing the laptop after minimizing the game, although I'm not sure that would work better. Wait at least 30 seconds after minimizing the game, and see if it helps to open a File Explorer window or something else that isn't demanding, so that that's the active window on-screen when you close the laptop lid.