I would think that it changes form in the sun not because of the ability. What I mean is, if it's ability got switched, it could still change in gen 4. But in later gens, if it lost its ablity, it couldn't change forms anymore. So in gen 4, it wasn't the ability that did it, but just the pokemon itself(that's what I think anyway, but I don't have proof so it's not an answer)