The Platform behavior doesn’t allow an object to overlap with solids, doesn't matter if it’s a floor or a wall. When it collides with a solid, the object is pushed back until it’s no longer overlapping, so there's always a small gap.
Directly changing X/Y values of the Platform object is not a good idea - you are messing with the behavior, not letting it to do its job.
A common solution to collision issues is to use two sprites: one invisible sprite with the Platform behavior, and another visible sprite with the desired collision mask and animation. You can adjust the position of the visible sprite if needed.