Note that I am not super familiar with writing tests for your codebase, so if you want me to add a test for this I could use a little guidance.
Fixes: #23523