WiFi error raspberry pi 4

I’ve installed ChirpStack Full Base and Basic on a Raspberry Pi 4, but encountered trouble with the WiFi on both operating systems. Upon initial boot, both the WiFi client and access point (AP) display an error message “Error: Unknown error (DEVICE_CLAIM_FAILED)”. However, if I log in to the ChirpStack web interface using a LAN connection and then restart the WiFi, it connects successfully. How can I troubleshoot this issue so that the WiFi automatically connects without requiring a restart after the first boot?