Process statement of account - not generating statements in any condition

we are using ERPNEXT for all our business verticals.

We have created an Auto Email to send Monthly account statements to our dealers via “Process Statement of accounts”
Recently after update it has stopped working and giving the below error. The statements cannot be emailed or Downloaded.

Please confirm this is a bug / if not how can it be made to work.

This error is there even if we give FROM date and To Date…