Cherry pick `In-framework inference fixes (10698)` into `r2.0.0`
[🤖]: Hi @janekl 👋,<br><br>we've cherry picked #10698 into `r2.0.0` for you! 🚀<br><br>Please review and approve this cherry pick by your convenience\!