I don't know the answer.
Technologically speaking, ublock origin runs on your browser and Chromecast runs as a separate instance outside of your browser, as a result the two are completely separate and have no effect on each other.
Generally speaking you can start a Chromecast session and then reboot your device/phone/computer/etc and the Chromecast will continue to play.
Now, for a time, the YouTube Chromecast session did not support ads. So it's likely you thought it was ublock origin, but in reality even if the extension were off, you'd still have no ads.