>>723378926
At the point where you scan the carriers, your Science Facility and Barracks are probably off floating somewhere to scout, so you'd need to bring them back to build the Covert Ops, start researching lockdown, and building up ghosts so they have enough time to even gain the mana for lockdowns, just like Protoss has to wait for high templar's mana in PvZ against hydra rushes.
This would take time, money, and attention all which are in short supply when you're desperately trying to push against carriers. And again, you can't simply rally out ghosts like you can factory units, they need to be babysitted the entire way. But let's say you didn't push and teched into ghosts. You'd probably need more than a few. In real situations pros lose caster units all the time without getting useful spells off, and we're talking 0 armor upgrade ghosts here, they're going to melt. If you have put so many resources into simply producing a few ghosts and waiting for their mana, they'd better manage to get at least one lockdown per ghost or you're basically fucked.
It's not impossible for the lockdown to win Terran a fight if positioning is perfect for the whole army and Protoss is caught off guard. The bigger problem is that the game state required to get to the point where this is even possible basically doesn't exist, because Terran will choose to push before the carriers every time, and that is probably going to be the correct move.