Considered an archaic word by most dictionaries, I was happy to stumble upon vagrom in David Bellos’ 2003 translation (from French) of Have Mercy on Us All by Fred Vargas.
Originally a malaprop (or Dogberryism) from the Dogberry character in Much Ado About Nothing (1598), its use carried through to the 19th Century.
The OED describes the alternative spelling as illiterate rather than perverted. Shakespeare might have disagreed with both takes on his coinage.
Vagrant itself (mid 15th century) likely ambled in from the Middle English vagraunt, vagaraunt possibly vía Anglo-French’s wacrant, walcrant – widely thought a noun use of the Old French walcrer (to wander).