Resuming a paused subscription through the API is not working as expected

We have set up our subscriptions to pause after the trial period ends, and in the scenario where the user hasn’t provided payment information when the user logs in and we see that the subscription is paused we get the user to enter payment details and I see that a default payment has been added to the subscription.

In our webhook endpoint I listen for the customer.subscription.updated event where I see default_payment_method has been defined and call the resume api

            stripe.Subscription.resume(
                billing_cycle_anchor="now",
                subscription=subscription.id,
            )

The problem is that this seems to try and update the current invoice (which has expired) instead of a new payment intent being created (which is what I see when I manually resume the subscription through the dashboard) and I’m wondering what I might be doing incorrectly here when trying to resume, or setting up the paused subscription in the first place

Note: I am seeing this in a sandbox where I am using simulation to pass time