This is a known bug which has a proposed solution - refer to https://github.com/gravitystorm/openstreetmap-carto/pull/4836
However, the OSM Carto project is basically unmaintained, so the bugfix may never get released...