A 10.000 ship would likely risk to sink.
A 100.000 tons ship would get serious damage.
What is a fault assumption is that a missile could penetrate at will walls.
It can't, because the warhead casing would get in turn serious damage with degradation of detonation properties or even only partial detonation.
Warheads are made of highly inert explosives, without the right impulse of heat and pressure they won't detonate, and collapsing against an armoured bulwark would in no way make the warhead detonate, but could damage or destroy the warhead.
So any missile, even if hypersonic, is fused to detonate with tenths of second after the first impact, to protect the warhead itself.
There would not be a detonation 20 meters inside the ship, because it would be too much probable that the warhead would be degraded or destroyed trying to get so deep inside the hull.
At the same time, it is a false assumption that a large warship like a carrier is full of dangerous items.
Ammunition and fuel are stored under the waterline, no missile could reach them.
Ammunitions' elevators and fuel piping run within armoured ducts, well within the hull.
Arming and refuelling happens on the flight deck only, no weapon and almost no fuel are allowed in the hangar.
It is not like naval engineers do not know how AShMs work.
There is only limited scope for passive countermeasures in smaller vessels, but as size goes up plenty of opportunities open up to the engineers to negate reach to critical parts and systems of the ship.
Like a II WW battleship was able to withstand a hit from a 381 or 406 mm armour piercing shell weighting between almost one ton to more than 1,2 tons, those being really armoured projectiles made only of steel and explosives, a modern day warship displacing far more than a II WW battleship would be able to withstand an incoming missile.
The same applies for any very large warship, it is just that a 300 to 400 kg warhead, terrific as it could seems, has just so much destructive power and radius, and as the hull grows in size, so grows the length the shockwaves have to run before reaching any vital part, ultimately being like outrun if the point of impact is not ideal.