My older Chromecasts had this issue sometimes, it would run at a substantially lower bitrate on primarily YouTube but others as well. It wasn't about my internet connection, it was stellar.
Now that I have a Realme 4K stick I find myself checking that the quality on YouTube is set to 4K if available.
Checkout SmartTubeNext, you can specify which quality and which codec to play rather than leave it on automatic
https://github.com/yuliskov/SmartTubeNext