Different behaviors while hiding apps in Test flight version and App Store version

I have an App that enrolls to MDM. So after enrolling to MDM we provide users with an option to :
1. Hide Apps.
2. Go back to default state with all the Apps.
This is what is happening on the developer version of the App and the test flight version of the App :
1. Install the app.
2. Enroll to MDM.
3. On hiding apps, all apps are hidden except for our App and the default apple apps.

This is what is happening on the app store version of the app :

1. Install the app.

2. Enroll to MDM.

3. On hiding apps, all apps are hidden including our App. (the default apple apps aren't hidden as expected)
I can't find a reason the test flight version of the app would be any different from the app store version of the app. The test flight version was what I submitted to the app store. Both the versions are pointing to the same MDM server, and the profiles installed are the same. So why would they acrt different.
Any ideas or suggestions? Any help would be greatly appreciated.
Thanks