I spent a bit of time trying to do it with flex sensors. Strap one to your hand, make a fist, take your nap, detect when muscle tone is lost and it unbends. I ran out of interest before I got it to work but I still think it's viable. Probably smart to build the flex sensor into a glove for ease of use, and you could put the microcontroller on there too.
You could also buy one of those two-piece door sensors that sound an alarm when you separate them. Tie one to your hand (or glue it onto a special sleeping glove), and hold the other piece.
Only potential problem is that you might get a heart attack considering how loud those things can be.
https://core-electronics.com.au/flex-sensor-2-2.html