Polygon cannot be attached to vertical walls

Look at this picture. I have created two polygons with the same coordinates. I pasted the red polygon on the 3Dtileset, but it didn’t fit perfectly on the vertical wall. How to solve this problem? Thank you very much.

this is my code

can anyone help?

You can use ClassificationPrimitive to fix this issue. Please see this example sandcastle.

Polygon entities are clamped to ground (which is why you can see it shows on the ground properly) but it is not clamped to tilesets which is the building.