Aristotle (no less) claimed that some animals could predict the weather. But his choice of prophet was the hedgehog. Groundhogs just don’t cut it.
The only element of the ritual that makes a smidgen of meteorological sense is recognizing springtime is a season of stormy change from a season of just plain cold/dry. With the latter being mostly sunny, and the former being mostly cloudy, that suggests seeing a shadow means your still stuck in non-stormy winter, while not seeing it means you are more in season-change mode, or more in Spring conditions.