Nelson had the choice whether to accept to be the officer responsible for the trial, but he was also within his rights to reject that role.
In January 1799 Nelson, who had wanted to punish Commodore Campbell (in Portuguest service) for burning the Neapolitan fleet had told General Acton “was Commodore Campbell an English officer, I should instantly order him to be tried by a court-martial for the positive breach of my orders to the Marquis de Niza. I am sorry it cannot be done by me to an auxiliary squadron”.
So he made it clear that he couldn't convene a court-martial to try Campbell because Campbell was serving in the Portuguese fleet acting as auxiliaries to Nelson.
But he made no such claim when it came to Caracciolo.