If, and this is just an if, the person's first of middle name was Hanna (from a family surname) and the family asked the details to be carned on a headstone then the stonemason could easily used the common spelling of the female name Hannah.
For example, John Hanna Smith was named for maternal grandfather John Hanna but known always as Hanna Smith. When he died the name was carved as Hannah rather than Hanna.
In any case it would be best to check the orginal stone and then other sources. Newspaper obituary, death certificate, burial register...