Irregular ligatures? happen in my font on only website

Hi there,
I encountered a problem with ligatures in my font. Please watch this GIF:
Screen Recording 2022-04-27 at 14.58.58

This error happens with specific pairs, like “un”, “uh”, “um”, “nn”, “nh”, and “nm”. And also happens on the only website (it won’t appear in Adobe Illustrator or any applications).

How can I fix it? This is the .glyphs file of this typeface:

Thanks in advance.

Any reason why you added “entry” and “exit” anchors to the “m” and “n”?

Thank you for reply.
I set anchors to fit stem and “nshoulder” components correctly. But I suppose it doesn’t work. Can I fix this problem by removing them?

You need to build the “n” from two components: a “stem” and a “shoulder”. The anchors need to be in those glyphs, not in the “n”. Add add a character link “#” to the beginning of the anchor name. That disables the cursive attachment that was causing the strange positioning.

Here is an example of such a setup:

I understand.
I thought it was unnecessary for this typeface, so I removed them. Then, the problem was fixed!
Thanks a lot!

Thank you for teaching the example.
I realised how to use anchors. I’ll use them for another project.