According to Bulbapedia, if you gain this ability from a Castform, it won't do anything. If you are Castform and you lose the ability, you'll be stuck in whatever weather form you're in currently.
"This Ability is made specifically for
Castform, so if other Pokémon obtains
this Ability, it will have no effect.
Conversely, if Castform loses
Forecast, it will be stuck in whatever
form it was in at the time."