Revert "Merge pull request #10901 from armstrjare/fix_query_null_foreign_key_on_new_record_collection_ids_reader"

This reverts commit 6675d713186c270de1c4684bc1e56742ea2e19e1, reversing
changes made to 919d1a19d5e7871d50c1531351fc3f736bad5d07.

I missed to check the target branch and wrongly merged it into 3-2-stable directly.