wifi Error: Scanning not allowed while unavailable

I just turn on the hotspot and it failed after that when I execute ifconfig it shows ap0 instead of wlan0 after that I used sudo iw ap0 del and sudo iw wlan0 del then sudo airmon-ng. Now when I run nmcli d wifi rescan or sudo nmcli d wifi rescan it says Error: Scanning not allowed while unavailable. The output of uname -a is Linux z-aspire5576 5.10.0-8parrot1-amd64 #1 SMP Debian 5.10.46-8parrot1 (2021-07-21) x86_64 GNU/Linux