Thank you for spotting this issue. Definitely, it was an oversight.
I have PR with the fix for this problem
https://github.com/discourse/discourse/pull/37023