Further to Sammy C's comments, I would say this is a question of design intent. Modern SSMs are not designed to penetrate a battleship's armour, and so they probably couldn't do as built. But if it became a requirement, I'm sure SSM warhead designs could be changed so that they could penetrate thick armour.
Most modern warships are considered "out of action" once their sensors and systems are knocked out. That is very hard to stop, and so a high explosive SSM warhead hitting a warship will render it ineffective quickly. This is not a new problem. In the WWII Second (Night) battle of Guadalcanal, the US battleship South Dakota was effectively knocked out early when a power failure took out its fire control and radar, rendering it blind in the night action. Its main belt armour was not penetrated.
Modern SSMs are large and have big warheads - 200+ kg of explosives. They are not designed for armour penetration. But what if they were? Consider the much smaller warheads on modern infantry anti-tank missiles. They have shaped charge warheads to burn their way through armour. A 1980s TOW 2 could penetate 500mm of armour with a 6kg warhead. That is as much as any battleship had. (The Yammato main belt was 16" = 400mm). So you can see that if a modern NSM with a 120kg warhead was fitted with a shaped charge, it could penetrate far more.
Also, whilst not heavily armoured compared to WWII warships, the steel on a modern warship hull (10+mm) is still a lot thicker than on a Toyota Corolla (1 to 3mm)