Sounds like an episode of the 80s Twilight Zone, "Dreams for Sale". Wikipedia has the plot summary:
On an idyllic outdoor picnic with her husband and their daughters, a
woman becomes confused and disoriented when sounds and sights begin
stuttering and events repeat themselves. She awakens and discovers she
is in a futuristic dream-making machine alongside hundreds of others
in a sterile, industrial environment with no view of the outdoors. A
technician explains to her that she was in the Dreamatron "Fully
Interactive Dream" machine, running a Country Picnic program.
He fixes the circuit board for her dream bay and tells her to relax
and enjoy her last six minutes before returning to work. Apparently,
her mind somehow fixed herself in the other life, and not her real
life. Still confused, she returns to her dream world and relaxes again
in her fantasy, but the machine burns out before technicians can
disconnect her, trapping her in the alternate reality forever. All
they can do is sadly note, "At least she died happy..."