> a certain group of farsi fonts do this while some do not.
I’m not really sure what you’re asking, but I have a hunch. InDesign changed the way it renders complex-script text recently (Harfbuzz text shaping was officially added in version 19), so I’m guessing that the fonts with Farsi support that are working for you were created more recently, and the ones that aren’t working for you are older. That’s just a guess, but if I’m right, try changing the Legacy Text Shaping setting in Preferences → Advanced Type and restarting InDesign. Or,, honestly, even if you can’t see an obvious Group of Old Fonts that are Broken and Group of New Fonts that Work, it might be useful to try switching text shaping anyways.
If that doesn’t resolve your issues, can you give us some more information? Can you tell us exactly which fonts are working and which are not, and exactly how you’re making your selection?