When Allah asked the angels to prostrate before Adam (AS) then Iblis refused. How did he deny the command directly given by Allah (swt) knowing that Allah (swt) is Almighty and that His punishment will be severe?

God (Allah)AngelsProstration (sujud)Iblis
When Allah asked the angels to prostrate before Adam (AS) then Iblis refused. How did he deny the command directly given by Allah (swt) knowing that Allah (swt) is Almighty and that His punishment will be severe?
Mateen Charbonneau, Sheikh Mateen Joshua Charbonneau achieved a certificate from Harvard University in Islamic Studies. He undertook Howza classes under esteemed scholars since 2013 and has been teaching at Imam Mahdi... Answered 3 years ago

He had the choice to sin or not. Some beings are stubborn and arrogant. We see this with humans as well that they know the truth of Allahs punishment yet still persist in sin knowingly.