What's the "bug" here?
One shape is aligned to the pixel grid, and the other is not and shows antialiasing (like it's supposed to).
If you work with Layer Masks and the contours are either vertical or horizontal Posterizing the Mask to 2 can help.
How did you arrive at the result anyway? Was it the result of a transformation or was a Feather set when you created a Selection or …?