iPhone not working but iPad is working with chromecast
I'm afraid that I don't have an answer with something as hard so sort as this problem remotely, but I don't believe it is your phone.

I have recently started to have exactly the same issue.
Both my partners iPhone and mine, which we both used regularly to cast to the Chromecast are no longer able to do so, and we are using an older iPad, which does still works.

I had initially come to the same conclusion that my phone must have been the problem, but I can't see that both of our phones, which are different models would have broken at the same time.
I’ll be looking to do all updates in case a recent one has triggered this.
We also have a more recent version of a chromcast (the round version) in another room, and the phones still work fine with that one.