M8 and M9 have no specialmeanings I know about, so I assume they get send as given. If you have in log commands activated I guess you see them as expected + line number and checksum. Inthat case I must assume it comes from Marlin doing strange things on these commands.
What happens is you connect with Arduino serial and send M8 or M9?