All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad
is His Slave and Messenger.
The movements you made during the prayer do not invalidate it, whether the insect in question was deadly or not. They are not counted as excessive movement, as the scholars have stated that crossing two or three rows during prayer for a need does not invalidate it. It is stated in al-Kharashi's commentary on Khalil's Mukhtasar, in the Maliki school:
“No prostration of forgetfulness is required when the worshipper walks two or three rows to reach a sutrah (an object placed in front of the praying person to prevent people from walking within his praying area), to fill a gap in the row, or to push away someone passing in front of him.” [End of quote]
Allah Knows best.