I have searched and read many posts regarding to my problem.
Many users encountered the same issue as mine. However, none of them received a solution or clear confirmation about this issue.
A new sandbox user works fine with the first purchase of a subscription item. But after expiration, if we want to resubscribe, it sometimes just fails.
More specifically, we are using https://github.com/RevenueCat/purchases-unity/releases/download/4.1.0/Purchases-UnityIAP.unitypackage with a Unity app.
When we click on a subscription button for a resubscription, the function PurchasePackage works fine without an error, but in the callback, we check customerInfo.Entitlements.Active.ContainsKey(entitlementId) and it is still false.
I think at least there should be a confirmation whether it only happens in TestFlight/sandbox environment or not?