Do you really have to have an API call at the app launch to force users to the newest build in TestFlight or is there something in App Store Connect that will NOT allow users to use an older app build?
TestFlight - Force Users to new build
May be you can try to force expiration of build in AppStore connect.
I expired the build and the user is still able to use the application without being forced to update to the latest version. All my internet searches says TestFlight doesn't force but I would have to think that cannot be true given the risk it could impose on users.