This was a deliberate and somewhat successful attempt to turn on long dormant genes, however sometimes in nature these genes get turned on without any coaxing from man. Such is the case of whales found with legs.
In addition to the mountains of fossil evidence to suggest that whales once walked on land, there have been so-called “freaks of nature” in modern times that clearly show this to be true. If you do a little research, I believe you can not only find documentation of whales in modern times manifesting vestigial external legs but also photos of such examples. Freaky stuff indeed, but fully expected and predicted by evolution itself. So much for each according to his kind. Of course such examples are “as rare as hens teeth” as the saying goes.
Freeman