You are correct, There are only 2 Johns in the 1790 census for Kittery, the third "John" I thought I saw was in fact Jonathan.
I haven't seen those Kittery sources (yet!!). I do most of my research on the internet. My line from Renald/Reginald Fernald branches from Portsmouth NH to the Kittery and Falmouth area then off to the Vinalhaven and Lincolnville area in Knox county where we spread out. (I was born in Rockland but moved away when I was very young.)
How well have you researched the line of John Fernald and Sarah Hincks? There seems to be some confusion between two of his sons, James and John.
James Fernald married Hannah Rogers on Oct 30, 1730. James was b. Oct 4, 1704. And John Fernald (Jr) 1st m. Elizabeth Rogers Jan 16,1723/1724. He 2nd m. Dorothy Main on 4 Feb 1730/1731. John was born 15 May 1698 and d. bef 18 Apr 1738.
But some Internet sources name a John Fernald III as the son of both!! Which can not be. They may have simply confused the parentage of said John III, seeing that James and John (Jr.) both married a Rogers.
This John III was born 3 JUL 1737 and died 16 May 1825. He was married to Sarah Wentworth on 17 Apr 1759. I have him listed as the son of James.
If the data is correct, this so called John III could not be your John the 3rd, as his possible father John (Jr.)died before 1738. And James was not the fathers name of your John the 3rd.
And regardless of his parentage, provided the data is correct. This John III could not be the father of Miriam as he died in 1825. And you have that Miriam's father died in 1794.
John Fernald (Jr) and his 2nd wife Dorothy also had a son John b. April 18, 1738. He is mentioned in John Sr.'s, will. This John married a Miriam Lewis. They also had a son John b. 1761 who is contemporary with your John the 3rd. But the father John, supposedly died in 1773 (his wife Miriam died in 1794.) Their son John married Martha Jones on Oct 15, 1782, reportedly in Kittery.
The only way you could be related to that branch is if the data is wrong. (ie date of death). But I think its a good place to research seeing there is a connection to the Lewis family and the possibility that your Miriam could be named after her.
Another contemporary for Miriam and John the 3rd's grandfather is John Fernald b. 1808 and Sarah Hanscom. They were married about 1830, supposedly in Kittery, But I can find no children listed for them.
Then there is John Fernald and Hannah
I'll have to check further to see if there are any more contemporary John Fernalds in the Kittery area.