PR now created.
https://github.com/civicrm/civicrm-core/pull/20342
Just checked CiviCRM 5.37.2 and this issue seems to be fixed.