How to snap to other object?

New to Figma. Why are 2 objects not auto-aligning when they are groups or frames? I have ‘snap to object’ checked on.

But it snaps and shows red lines, seemingly randomly.

The groups are on the same level in the folder structure. But this shouldn’t even matter in my opinion. In XD and Sketch it can snap to whatever is in your viewport. Thats what you want. Now its just tedious having to align all the objects manually, setting rulers, drawing lines… etc

Please check this post of the same issue.