This article covers
Why the titled error occurs?
Solution
It is not possible to create advance invoices for the subscription in the contract term which is scheduled to end. You can only raise advance invoices for subscriptions on contract within the current contract term.
Related articles and Documentation
https://www.chargebee.com/docs/2.0/contract-terms.html