Hi,
Check if you have any Invoicing date field updated in the customer master
Compare the customers for which the Billing date has fallen on Last date of month with the current customer
This could be the reason, functionally
As a start please check and update
regards,
santosh