Wifi not connect when boot but connect after reboot

We can probably do little about either your router or wpa_supplicant.

Since this situation only occurs on a cold boot and can be easily fixed in the Kodi interface, a simple script in /etc/rc.local should be good enough.

Add these lines before exit 0 in /etc/rc.local:

/bin/sleep 10
if ! $(/sbin/ifconfig wlan0 | /bin/grep -q 'inet 192.168.1'); then 
    /usr/bin/connmanctl connect wifi_xxxxxxxxxxx_managed_psk >/dev/null 2>&1; 
fi

The sleep should allow enough time for the WiFi connection to finish. You can adjust it, as necessary. If you don’t have an IP address after the configured time, it will try to connect to the AP. Hopefully, this will work.

You should also change xxxxxxxxxxx to the correct value for your WiFi interface (connmanctl services will show you what it should be).