Cannot download some call recordings

I cannot download some recordings in CDR Reports module. When I press “Play” button, it’s ok, recording plays, but when I press “Download” - just blank page.

I looked into cdr module (page.cdr.php, line 60), and checked the SQL script. When running from module, it finds nothing, but when running from mysql directly, it finds the corresponding recordingfile correct.

This happens on some recordings (about 5%-10%), not on all.

The FreePBX distro, latest version with all upgrades.

Correction: when running from mysql cli, this script returns 2 records, first of which has empty recordingfile.