Several example sketches fail

I must admit that I also thought that the examples were board specific, so thank you @ptillisch for the explanation.

At one time one could more readily align the board name with a specific MCU - UNO/Nano=328P, Leonardo/Micro=32u4, Mega=2560 etc, none of the official Arduino boards had WiFi capability and to add WiFi one had to add a separate ESP8266 or ESP32 module, so this situation never arose. But as things have moved on, we have seen a proliferation of newer boards that now include onboard WiFi modules (Nano ESP32, Nano Connect, UNO WiFi Rev2, UNO R4 Wifi, Gigi Wifi etc) and that's without mentioning third party versions. Boards that have an onboard ESP32 have, in effect, two MCUs. We now also have versions of the same board with and without WiFi. The picture has become a little more complex. The board packages evidently remain categorized by their core MCU platform which is fair enough as the included WiFi module is a peripheral. It is also understandable to include of all examples - including the WiFiS3 related ones - pertaining to the platform, within the package. However, is there no way, for the purposes of clarity, to filter out and not show WiFi examples when a the board that has been selected does not have WiFi capability? Is there no #define value or some tag in the board definition within boards.txt that could be used to determine this? I think that would be useful to avoid this kind of confusion and address the increasing number of permutations.