Data from public trees or any tree you find on the internet should only be used for clues.
When posting, it helps if you make events very clear, such as using: b (born), m (married), d (died) before the date.
Here is the link to the clear copy of the marriage record of John Maher (b abt 1793) to Rose Anne McGrath, married, 23 May 1835, Percé (Saint-Michel-de-Percé), Gaspe, PQ, CN. familysearch.org is a free site.https://familysearch.org/pal:/MM9.3.1/TH-1971-27980-6357-43?...
In this document, it states the name of (deceased) first wife of John Maher as Nancy Kennedy. It can be asserted the info on his first wife is accurate (providing the priest didn't make an error, and there is always a chance of human error), since it came from John Maher.
There is also another clue in the document, a Nicholas Maher is a witness, and I'm guessing he was either a son from the first marriage or a brother of John Maher.
This is the kind of evidence that should enable you to continue your search.
I suggest you research all the children of this couple, find the bap records for all of them, and make note of godparents, you might find associated family members to build out the families.
You might also look for marriage documents for the children of the first marriage in the Gaspe region, in the period of 1840-60. The name of their mother will be in their marriage records, this can confirm the data learned in 2nd marriage record of the father.
John Maher was indicated as a farmer and fisherman in his burial record. I would keep that in mind as you research back.
After you exhaust the documentation in Canada, you should have enough data to move to Ireland. The children from the first marriage should be included in your search, they were born in Ireland, correct? Follow them and they'll lead you to when and where you should be looking for a marriage of John Maher and Nancy Kennedy and further back.