EntryModel::populateModels throws a 500 error
There's probably an error in craft/storage/runtime/logs/phperrors.log and there's a 99% chance the problem is you're hitting your php.ini file's memory_limit setting.

Populating 5,000 models is going to take a significant amount of memory.