A little belated, but just to round this off… This was fixed in:
https://github.com/discourse/discourse/pull/17885