Windows 10 won't go to sleep while Unity is open

The title explains it all.
I have tried with every other app closed except unity and the pc won’t go to sleep (the monitor does).
I am using Unity 2019.3.7f1. I Have tried with a brand new project but the problem was still there. I also tried with the 2019.2.17 and still the same problem.

My computer normally goes to sleep, so it is not another program that is causing the problem.

All the tests were run with only unity open. If i manually put it in sleep it works, but otherwise no.

Also, closing the project every time is not a viable solution as it is pretty big and i would spend several minutes to reopen it.

I am using Windows 10 Home build 19041

Still having this issue, did you manage to find any solution?

Been having this same issue for many months.

Have a look at this link Windows 10: PC Won’t Go to Sleep Mode.
Also make sure to read the comments, there are pretty useful CMD commands in there.