To initiate a scheduled invoice generation, an Autolaunched Flow invoking the Invoice API invocable class should be created where the flow will be called in a Batch Job.
...
Go to Setup.
In the Quick Find box, search and select Batch Management.
Click New.
Enter some required data and click the autolaunch flow that’s been created a while ago and click Next. In next screen, select the recordId as Flow Input Variable and Opportunity as Object
Note: The required batch size would be 60 only to prevent hitting the governor limit
...
Click Save.
Create a Schedule Flow
...
System.schedule('Schedule_OrphanGatewayTransactionInvoiceLinker 1', '0 30 * * * ?', new PosiPay__.OrphanGatewayTransactionInvoiceLinker());
...