I'm working on recreating a base map style inspired from Mapbox Outdoors in QGIS. For this, I am using the Mapbox Terrain vector tileset as a Vector Tileset in QGIS. I can style features and add some labels, however I am encountering some issues with contour lines as they are served as polygons by Mapbox.
It seems that the contour lines themselves draw fine, as you can see below (the green lines).
However I am encountering issues when trying to label them with their correct elevation. It seems that QGIS doesn't merge the polygons across the different tiles and I am left with a bunch of labels on the border of each tile. This is staggering in the north part of the selected feature. I have tried
buffer(collect_geometries($geometry), 0) but it doesn't seem to make any difference. Adding a text marker to the line rendering itself does work but it is far from ideal as there is little to no control on this.