Moses said: “I did it then, when I was in error.
This was the answer of Musa (pbuh) to the objection of the Pharaoh that
Musa (AS) had killed an Egyptian. The gist of the answer is that it was
not a deliberate murder; in fact the Egyptian was killed by mistake,
because Musa (AS) had only struck him with a blow which, by accident,
caused his death. The word used, by the present verse, for this mistake is
derived from (dala) which is commonly used for intentional error.
But the word is also used for ‘unawareness’ (which includes unintentional
mistakes). It is this meaning that is intended here. This interpretation is
supported by Qatadah and Ibn Zaid (RA)
Shafi, Muhammad (2008). Maariful Quran. (Vol .6 surah 26 verse 20). English-MaarifulQuran-MuftiShafiUsmaniRA-Vol-6.pdf (islamicweblibrary.com)