Glorious, and the Battle off Samar.
But even two major screwups like these don't make for a compelling argument to equip carriers with heavy guns.
How much more expensive would those escort carriers be if they had the guns and armor to defend against a surface task force with heavy cruisers and the friggin' Yamato?
The IJN Chiyoda, having been disabled by USN carrier aircraft during the Battle off Cape Engano on 25 Oct 1944, was dispatched by a USN task force of 4 cruisers and 9 destroyers, before she could be scuttled and her crew rescued.
USS Hornet CV-8 was another crippled carrier that ended up, after being abandoned by her crew, being finally dispatched by two Japanese destroyers on 27 Oct 1942.
Was it HMS Formidable that was part of the line of battle in a night action in the Mediterranean?
Yes, during the Battle off Cape Matapan in March 1941. She got a 4.5in salvo or two off before being told to retire and leave the gun battle to the battleships and cruisers.
Edit- she was tail end Charlie to the line of 3 battleships. From one of her gunnery officers.
"We saw a group of coloured flares fired from Warspite, which were in fact the night challenge signal, then, almost immediately, the battleship's searchlights were switched on to reveal to our amazement three sleek-looking light grey warships, their guns trained fore and aft. Within seconds there was an ear-splitting roar as the 15-inch guns of our battleships opened fire at almost point-blank range. The result was immediate and devastating. I vividly recall seeing a complete turret of the leading ship disappear over the side. Masses of flame soon enveloped all three ships. Although we received the order to open fire the order was almost immediately countermanded as Formidable turned out of line to starboard.
One salvo was in fact fired by Formidable, and this must have been one of the few occasions during the Second World War when an aircraft carrier used its main gunnery armament against a major enemy warship."