#11516 added downcast_ref to SessionState in couple places with TODO comments. These places should be revised. Perhaps CatalogSession API should be extended so that downcast is not needed, or functionality refactored (e.g. as proposed here: #11516 (comment)).
Context