macOS has an annoying feature that will wake the computer periodically to check shite like email and messages and then go back to sleep. I do not know if the notifications we're interested in are invoked by this default behavior. I've disabled mine to avoid burning the battery with the lid closed.

On Thu, Feb 6, 2025 at 10:37 AM Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
> What is the semantics of this?  If the user closes the lid of the
> laptop, and that was defined to put the system to sleep, does such
> "inhibiting" mean the system will not sleep?  If so, I'm not sure this
> is supported.

Don't know about "supported", but failing to sleep when the laptop is
closed can be a major problem (I only experienced the milder versions,
like finding my laptop with an empty battery, or my backpack all dirty
with melted chocolate, but overheating can be a serious issue).

[ Of course, it can also be useful, when the laptop is docked into
  a keyboard+screen station, or when you want to use it as a headless
  server.  ]


        Stefan