In 1761 he returned to Dublin, and the supply of parochial clergy at the time being insufficient, he was asked by Archbishop Richard Lincoln, and was permitted by his superiors, to take up the work of a curate in St. Paul's Parish.
In spite of Dr. Gahan's advice and that of John Thomas Troy, Roman Catholic Archbishop of Dublin, Lord Dunboyne insisted on willing his County Meath estate to the trustees of Maynooth College, recently founded (1795) by the Irish Parliament.
He refused, of course, to do so, and after undergoing six painful examinations in the Chancery office in Dublin, he was committed to jail at the Trim assizes, on 24 August 1802, to which the case had been referred for final judgment, his persistent refusal to testify as to the religion in which Dunboyne had died being ruled by the presiding judge, Arthur Wolfe, 1st Viscount Kilwarden, to constitute contempt of court.
As there were no Catholic cemeteries at the time, his remains were laid to rest in the graveyard attached to St. James's Protestant Church.
His other writings include: In James Joyce's story Araby, a copy of Gahan's "The Devout Communicant" is one of several paper-bound books which the protagonist - an adolescent boy in Dublin at the turn of the 20th Century - finds among old papers left by a deceased former tenant in his home, who had been a priest.