Thank you for reporting this bug. It was fixed with this PR :
https://github.com/discourse/discourse/pull/23894