Big welcome to the forum by the way - I only just noticved these are your first posts here !
ok, that’s great that you’ve confirmed that the project properties is 4.1.
The other issue that often comes up with the WiFi module is power. We have seen at least one other case where the module would appear to work and then when it went to connect to the access point, it would reset. That is different to your scenario, granted, but can you tell us how your mainboard and module is being powered?
Also given your newness to the forum, can you tell us if this has ever worked, or if you’ve just got your mainboard and wifi module?