For Skill Swap, it WOULD work, except the ability does nothing. So congrats, you just lost your ability.
I would guess that it would be the same for Role Play, since other Pokémon don't have sun, rain and hail forms.
Note that you can surpress this ability with Gastro Acid, which will make the Castform turn back into its normal forme. If Castform regains Forecast, it would revert to the forme it would be supposed to be in (that is, if there is weather).