That’s one strategy. The difficulty is that Casterly Rock is honeycombed with tunnels already and is geographically massive, so it’d be hard to pull that off.
Honestly, if I were going to besiege Casterly Rock, I’d cut off the harbor entrance (sinking a bunch of hulks should do it) to prevent resupply from the sea, and then dig a moat around the entire landward side to starve them out.
But even then, six months is a very optimistic projection. Sieges can take a long long time, even without the absurdly spacious storerooms of the Rock.