Yes the first time. But if you start the battle when it is hailing, it will block it, but when the player uses Sunny Day, Hail, or Rain Dance it will work because Cloud Nine and Air lock only work 1 time.
My favorite Cloudy Castform moveset.
Hail, an absolute must.
Ice Beam or Blizzard to make a STAB and Blizzard because hail makes the accuracy 100%
Water Pulse to deal with Fire, Ground, and rock.
Toxic because if the pokemon is confused by Water Pulse, the pokemon is now poisoned. That is good because if the pokemon is hurt by its own confusion, toxic will help the confusion kill the pokemon.