This post from april talks about the same issue. Sandeep_Asrani had the following fix.
https://discourse.pi-hole.net/t/pihole-up-wont-update-past-core-5-17-2/69315/3
cd /etc/pihole sudo mv versions versions.bak pihole updatechecker
This fixed it for me.