Interestingly, one of the comments mentions the tank story as an example of the same issue:
Rainer Kordmaa • 6 months ago
Kinda reminds me a story of how a neural network was
trained by military to detect camouflaged tanks on
terrain, except pictures with tanks were taken on a nice
sunny day and pictures without on a cloudy day and instead
of a tank detector they ended up with a sunny day detector