After breaking my head on why my macbook would not sleep I figured out Node-red is the culprite.
I use 1.0.6 right now but this was also there in 1.0.2 Firefox version 75.0
When I open the node-red web page the following task is spawned in FF:
FirefoxCP Web Content and preventing sleep is set to yes.
Basically this tells my laptop not to go to sleep even if the lid is closed.
Could I ask that this be a toggle switch of turned off?