Update: a fix has been merged, and from the labels on the PR I think it could make it to 5.4.1. Wait and see.
See https://github.com/elastic/elasticsearch/pull/24879