I got a way to avoid that.... Before you get close to a door, check your radar. Make sure there are 2 red dots within range. If there is only 1, stay away from the door. Prefects always come in pairs during the day time, so if you approach a door with only one dot visible, back-up is sure to arrive via the closest door.