Take him/her back
Toddlers can get stuck in a zone where they want you to do everyting they want & they don't understand or accept limits.
Yet limit setting is important & this is a great learning project. Kids should be returned every time to their room & offered the choice of staying with the door open or being locked in. A few tears later they desire the open door & the promise of access it gives. Be firm.