It happens when you have an apnea as you breathe out rather than breathe in, as is more common.
My ENT suspected this and put me under anesthesia to put a scope in my airway while I was sleeping. He found that I had expiratory palatal obstruction.
Follow up question, if you have this, what is your preferred sleeping position? Mine is on my back. I’m wondering if others have the same preference.