if you have root try this. that helped me.
su
su
pm disable com.android.captiveportallogin
settings put global captive_portal_detection_enabled 0
settings put global captive_portal_server localhost
settings put global captive_portal_mode 0
reboot
I have the same problem with my Mi 9 with 20.07.23. after a restart it takes up to 5 minutes to start Afwall, Tasker ... You can start the apps manually without any problems or wait 5 minutes until the system has started completely.