This is an interesting topic, I like teasing out the details.
Attacking with modern weapon also mean the target warship would be more modern, resilient target.
The Dragon entered service in 1975 and small-medium warships last for about 20 years or more, so a ship built after say 1960 is well within the time bracket for a Dragon. As for new ships being resilient, the aluminium superstructure damage of the Type 21s in the Falklands and USS Belknap collision, and the way the Sheffield burned enough to be abandoned show that isn't entirely true.
a) Targetting a box of artillery shells behind armour shield may be impossible
I don't think many post WW2 ships have armour, certainly not smaller ships; they're just structural plate steel.
b) Modern artillery shells do not sympathetically detonate - likely only propelling charge of 1-2 shells which were hit directly will burn, violently enough to scatter the rest of shells and to disable gun mount, but not enough to destroy the ship.
c) Artillery shells may be not in gun mount - modern vessels usually have an automatic elevator or even belt stretched from under-deck magazine. Normally below water line where hitting it may be difficult.
Modern naval gun mounts extend well below decks, with loading rooms, elevators and magazines all pretty much directly under the turret. Hitting the hull with a warhead designed to penetrate through several inches of armour will most likely send white hot spall into areas full of shells and propellant, which will then likely start several fires, not to mention fires that might start from other flammable things like plastic cable insulation etc. Such fires will quite likely endanger the ship.
d) Anti-ship canisters are mostly solid fuel motors. These either simply burn or explode weakly (1-10% of TNT equivalent, dependent on size) if hit.
A solid rocket sustainer motor in an AShM burns uncontrollably (in the sense that it can't be shut off or throttled back) for something like a minute, not to mention the fast burning boost motor. It was this continual burning that doomed the Sheffield, the motor burned for quite some time after impact. Having an intense fire burn for a minute on a small ship will endanger it by melting it and starting other fires such as the missile adjacent the one that gets hit and providing enough heat to cook off the warhead.
e) Hitting precisely anti-ship missile warhead in canister may be difficult - too small target.
Hitting any part of the missile will do, and they're not a small target.
f) Anti-shipping missiles are typically designed to jettison automatically in case of in-canister fire (with blow-out panels and position to fall clear off deck). Not sure about all models, but the warship photo of which you provided seems to be designed with emergency jettison in mind.
I didn't know that, I'll check tomorrow but the picture above doesn't look like it would be very easy to do.