Csv export doesn't work for >4 records at once

I recently migrated our legacy CRM (7.4.1) to a different webserver. It’s not running in docker in a custom (legacy) php and mysql containers…

We now notice for one single module (AOS_Invoices), we can no longer export records as csv. That is, we can select up to 3 records and export them as csv successfully.
But as soon as I select 4 or more records I get an empty screen.

I see nothing in the logs that could point me in the right direction.

csv-Exports of all contacts, all accounts and other modules I’ve tested works fine.

I can copy the query from the log and run it in another sql program (connected to the same database) and it works fine.

Any ideas for debugging and fixing appreciated!

Did you check the php error log?
How much memory is allocated to that container?

Regards