I also checked with Tasker, as that sets an alarm as well for certain things, but it doesn’t kick me out of DND nor does it turn off bedtime mode.
(The task in question is one that turns on the flashlight when I shake the device, like the old Moto chop gesture. It turns it back off after a few minutes, which is what the system alarm is for I guess.)