If the sun is too high in the sky, you won’t see a rainbow.
The only time you can see a rainbow is either in the early morning or in the late afternoon. There’s a reason for this.
For you to see a rainbow, the sun has to be in back of you and shining through the rain.
If the sun’s too high, any rainbow that might form would end up projected below the horizon, making it invisible.