AI breaks my hiding system?

I have a AI character that will hit me and do damage when it sees me, and overall this works well. But I have some hiding systems set up, in wardrobes etc., and if the character hits me in that trigger box for the player to hide, when they hide, they can’t then get out. I have it so the player’s location is set within the wardrobe. Is there any reason this happens, as it only ever happens with the player is in that trigger box.