Pro Rate is not working on membership upgrade

I created an annual membership for $160 that would Cancel and Pro-Rate a weekly membership that charges $5/week. A user upgraded. The invoice showed a full bill for $160, but the description on the invoice actually showed $157.__

and we couldn’t figure out why. I bet it’s because it was trying to prorate the upgrade

but it didn’t do it right and the user did not register fully – most likely because they didn’t see any discount applied from their previous membership.

We are using Stripe as a recurring payment gateway.