This happened to me twice today during a hostage rescue mission in NY. After completing the activity I enter the container to collect the bounty and the doors shut locking me inside. No big deal as I could still fast travel out of them to another location.