Old English hearm "hurt, pain; evil, grief; insult," from Proto-Germanic *harmaz (source also of Old Saxon harm, Old Norse harmr "grief, sorrow," Old Frisian herm "insult; pain," Old High German harm, German Harm "grief, sorrow, harm"), from PIE *kormo- "pain." To be in harm's way is from 1660s.
word-forming element meaning "lacking, cannot be, does not," from Old English -leas, from leas "free (from), devoid (of), false, feigned," from Proto-Germanic *lausaz (cognates: Dutch -loos, German -los "-less," Old Norse lauss "loose, free, vacant, dissolute," Middle Dutch los, German los "loose, free," Gothic laus "empty, vain"), from PIE root *leu- "to loosen, divide, cut apart." Related to loose and lease.
Others are reading
<a href="https://www.etymonline.com/word/harmless">Etymology of harmless by etymonline</a>
Harper, D. (n.d.). Etymology of harmless. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/harmless