The Be'er Yosef in Parshas Masei quotes the Arizal's Shaar HaMitzvos parshas Shoftim as follows:
...הרג את המצרי שהוא קין, היה שוגג, כי הוא חשב שהדין עמו על שהרג הבל, ולכן הרגו בשם המפורש כדי לתקן ע"י שם מ"ב וכו' אמנם חטא בזה כנז' בר"מ פ' משפטים
[Moshe] killed the Egyptian who was Kayin (a gilgul?), [and was therefore considered] a shogeg, since he thought he was justified, due to [Kayin's] murder of Hevel. Therefore [Moshe] killed [the Egyptian] with the explicit name in order to rectify [his soul] using the 42 letter name... however he sinned with this, as mentioned by R"M parshas Mishpatim.
Who is ר"מ, what was Moshe's sin, and why is he considered shogeg?
(The Be'er Yosef brings earlier from the Shaar Hapesukim parshas Mishpatim that he was considered shogeg since his intention was to correct his soul by killing him with the explicit name, still unclear why that is)