During my playthrough, the first time MC is back in their room after Mariana switches us to female clothing ($ht=10 on Sun event), the MC is blocked from leaving due to "You can not leave in male clothes" message. Looking at wardrobe, removed socks and bottom (so both are now "none" due to female dress being used). Still doesn't allow MC to leave. I looked at the if-then check in a real editor (Twine passage editor sucks) to see that you are looking at all of the following to see if they are set to "male": $top, $bra, $bottom, $panties, $socks and $shoes.
At that moment, I jumped into the console to took a look and saw they were set to "female", "female", "none", "male", "none" and "female". So $panties was still set to "male" even though the wardrobe shows that the female panties given to MC to wear back at stage 1 are being worn. I'm pretty sure I didn't change those out at any point so this state is probably what was left over after that event. I had to take off Chanel's panties and then wear them again in the wardrobe before the $panties variable got properly set to "female". That finally allowed MC to leave their room.