Because of the situation, Bahlool acted insanely by the Imam's order. By doing this, he was saved from Haroun's punishment.