Royal Navy incompetence put an Irish trawler crew at risk after one of its submarines became snagged in a net and nearly capsized the ship.