Although it doesn't quite match the time frame or all the details, this does sound a lot like the 2017 short film "Laboratory Conditions," starring Marissa Tomei and Minnie Driver. The entire seventeen-minute film is available on YouTube.
This review has a partial plot summary:
The film begins with a low tense, dramatic music, hushed up voices, and dim-lit setting, all conjuring up an atmosphere of mystery. Dr Emma Holloway (Marisa Tomei) is in search of her missing deceased patient. She notices an oddly-behaving ambulance and follows it, which leads her to a huge laboratory where an experiment is to be carried out on the stolen patient, still alive but barely, under highly regulated and monitored conditions. All this is under the supervision of a scientist, Marjorie Cane (Minnie Driver). She, along with Robbins (Paulo Costanzo) and a bunch of others, wishes to determine the exact moment when the soul leaves the body.
The experimental procedure does involve placing people in a glass-walled box that is supposed to be impervious to souls—thus trapping the souls in the box after their body's deaths. And at the end, one of the female leads does indeed get trapped inside the experimental chamber, although not quite according to the sequence of events described in the question.