Out of sync commits when squashing in merge

Hello Community. This post is basically the same as Merging and clean commit history which didn’t get a reply. In short: I merge a branch into main, squash the commits, and then have both in sync. However, those squashed commits still show up as “ahead of” the main branch. Is there any way to keep a clean sync when squashing commits? Thank you