You are running this query on the store database server. correct? Can you put any other receipt number and execute the query?
I have had scenarios where a receipt got printed without receipt ID. Your scenario is strange as you have a receipt on hand with a proper receipt number. How many such transactions do you have ?