After a while of using wifi, it just stops to work and sometimes reconnecting the wifi works sometimes one need to reboot the net-vm and sometimes this also does not help and one needs to reboot the whole machine in order to get wifi working again.
I saw such flaws once with kali but never investigated too much on it.
Any ideas on this problem?
In most cases, it should be relatively easy to fix.
Here is the official Qubes guide to this very problem https://www.qubes-os.org/doc/wireless-troubleshooting/
I can rapport it certainly worked for me, having had exact same issue as you describe. No more loose of internet connection after suspend/hibernate, quick internet after suspend or hibernate, and no more dom0 kernel panic reboots out of nowhere.
I also discovered if you keybind the rmmod/modprobe wifi module process in addition to putting them on the blacklist as described in the list, you can force your network to quickly regain network, if it happens to be slow to connect or the discover is slow to become available when suddenly in range. But mostly the blacklist is sufficient enough.
Even if it's happening outside hibernate/suspend, a keybind to the rmmod/modprobe process can in many cases quickly fix it, without having to type it manually or reboot your entire system. I never have to reboot anymore, having been in your shoes once. Hopefully this works for you too.
Here's the keybind
"qvm-run sys-net 'bash wifi-resume' "
Add it in Qubes menu --> Systems Tools --> Keyboard --> Application Shortcuts.
Then in your wifi-resume script, throw it in your sys-net home folder.
Write something akin to in the script, albeit with your own wifi hardware module names.
sudo rmmod iwlmvm
sudo rmmod iwlwifi
sudo modprobe iwlwifi
sudo modprobe iwlmvm
But try the blacklisting first before making a keybind, since the automatic process is easier than a keybind, and it may be sufficient. The keybind is just for extra control or in situations it was not caused by suspend/hibernate.