Wifi problems with Gigabyte 570x Aorus Pro WIFI and Ubuntu

Dual booting Ubuntu and Windows causes the WiFi card to not be detected sometimes.

The behavior appears to be random. Sometimes it fully works, sometimes it does not.

After hours debugging I found a workaround that is presented in the answers section.
However I cannot explain why it solves the issue.

This may be related to the problems reported here:

My setup:

Dual boot of windows 10 and ubuntu 20.04 (it appears to also be a problem in 18.04)
CPU: AMD Ryzen 9 3900X
Motherboard: Aorus x570 PRO wifi
Wifi hardware: Wi-Fi 6 AX200

When wifi appears successfully on Ubuntu I can see the following wifi related loaded modules:

$ lsmod | grep iwlwif
iwlwifi               331776  1 iwlmvm
cfg80211              704512  3 iwlmvm,iwlwifi,mac80211

Go to Source
Author: nico