Diagnosis
The dispenser door latch mechanism is gunked up with old detergent or rinse aid, or the spring is weak.
How to Fix It
Manually open the dispenser door. Clean the entire cavity and the door hinge with a small brush and warm water. Wipe dry. Operate the latch by hand to feel for grit or stiffness. Lubricate the moving parts with a tiny amount of food-grade silicone grease.
If That Didn't Work
The dispenser solenoid that releases the door may be failing. It's a small black cylinder behind the dispenser. Unplug the dishwasher. Test it for continuity (about 2-3k ohms resistance). If it's open or shorted, replace the dispenser assembly, part number W10701630.
Heads Up
Using too much detergent or the wrong type (like hand soap) creates suds that gum up the mechanism. Use only dishwasher-specific pods, powder, or gel.