Not a partner, but my DS had terrible night terrors from 15 to about 22, following on from a trauma crisis plus a background of childhood trauma.
I sleepwalk and sleeptalk but DS is adopted so no genetic link that I'm aware of.
With DS it actually became worse, from what he says, when he was removed from an incredibly stressful living situation and placed with me. His psychiatrist said that it was probably feeling safe and supported meant he subconsciously felt able to express his fear and pain and this was "spilling out" during sleep.
When he first came to live with us he was waking the whole house up at least a couple of times a week, but as he settled in it gradually became less and less frequent. It flared up again when he was in a bad housing situation in his early 20s but since he has moved back in with me he has only had one in the past year.
He was briefly on melatonin and amitriptyline during the worst times but didn't seem to make any difference.
I frequently found him flailing at closed doors thinking he was trapped or locked in. He also fell down the stairs a few times (luckily they were the two-level type so he only went down about 6 steps and never hurt himself badly.)
What did really help was learning to manage his stress levels, and having a better bedtime regime.
His psychiatrist advised me that it's better not to try to wake the sleeper fully, but just guide them back to bed if you can and make soothing statements like "It's okay, everyone is safe, you're safe and everything is okay." I would then sit on his bed for 20-30 mins while he fell back to deep sleep. Then he would have a rest the remainder of the night whereas I'd be unable to sleep any further due to adreniline rush!
This will sound dumb, but one of the biggest pains for me dealing with it was that I HAVE to sleep naked (if I put PJs or a nightie on then I simply wake up to find I have cast them off during the night) so when DS would start screaming and shouting I would have to lose 2 seconds to get to him in grabbing my dressing gown.
OP to address your specific situation. You haven't stated your DH's diagnosis or reason for medication, but have said that if he forgets a pill, you know you're in for a rough night. How often does that happen? If it's more than once a month, I'd suggest putting some safeguards in place to remind him to take it. It's really not acceptable for him to be frequently "forgetting" to do something that then puts you at risk of getting physically hurt!
I would definitely recommend he overhauls his bedtime routine with a view to winding down to sleep over the space of about an hour. So if the target sleep time is 11pm, the evening could look like this:
10pm Switch off/put away all phones, laptops, tablets etc
10pm Have a chat about how today's been with you - you both get to talk about anything on your mind
10.15pm List three things he's happy about or grateful for today - doesn't need to be deep or meaningful, "I had a really tasty pizza today" or "The sun was shining after days of shit weather" are totally valid!
10.30pm Start drinking a cup of herbal tea, and/or take some herbal sleep aids. Nytol is the main herbal brand but Wilkos do their own version for about £1 per pack and the contents is identical. Bear in mind that if you have a cat, valerian is in most herbal sleep products and is related to catnip, so you may find your cat trying to fish the teabag out at 2am 😂
10.45pm Get into bed. Earlier in the day he should have made sure the bedroom was welcoming and calming, e.g. bed made up, not just duvet crumpled at foot of the bed, bedside lamp on rather than overhead light, clean bed linen, temperature in the room not too hot/cold, electric blanket on if he feels the cold, etc.
10.45pm Listen to something soothing that will help him drop off to sleep calmly. A favourite album, David Attenborough narrating wildlife, a kids' film (I can't tell you how often I've watched Wallace and Grommit at bedtime.) If possible, play this media on a device which will cut off within half hour or so. EG I'll Chrome cast to my TV but put my TV on sleep timer for 30 mins.
I really hope some of this helps OP (and all others.) Honestly I would find it very challenging to be in the same bed as someone who did this so you definitely deserve medals!