I have noticed different behaviour with sway and dwm.
When dwm is screenoff and dmenu appears it is still consuming physical button presses at the same time as the lock - unlock - screenoff loop is happening.
On sway this doesn't happen until the system is in unlock state.