Is there a word that means "doing the right thing for the wrong reason"?
Is there a word that means doing the right thing for the wrong reason or getting the right conclusion from the wrong set of presumptions?
The word unwittingly seems close, though you may have to qualify it. I found an example I think demonstrates this use (see page 140 in the search results).
How about a new word: corraccidentally