I wonder how the Navy felt about these two movies and their portrayals of ship captains (Cagney and Bogart).
They did co-operate with both films so perhaps it was acknowledged that with thousands of ships in the Navy during WW2 there were bound to be substandard captains on auxiliary ships.
The Navy wanted it to be shown that the captains involved were aberrations that would be taken care of "in-house" so to speak. The credits given to the Navy at both the start and (especially) the finish of The Caine Mutiny are pretty obsequious. Getting the Navy to cooperate about Mister Roberts may have been made easier by the fact that both Ford and Fonda were Navy vets from the war.
Both films fared better in this respect than had From Here to Eternity. There, the Army agreed to cooperate only on condition that the fate of Captain Holmes be changed from the book. In Wouk's novel Holmes is promoted despite his incompetence and mistreatment of his subordinates. In the film the Army finds out what he's doing, forces him to resign and metes out punishment to those who tormented Prewitt, a change and a scene director Fred Zinnemann always hated. The Army also forced other changes from the book to improve its image.
It's just a coincidence of no consequence, but it struck me how, in The Caine Mutiny, the three officers go over to the flagship on their aborted mission to talk to Admiral Halsey about Captain Queeg, while six years later James Cagney of Mister Roberts played Halsey in The Gallant Hours.