Fixes: #9230 Some code was present in the code snippet that shouldn't be there. **Auto-cherry-pick to `6.3.x` & `6.2.x`**