"He didn't have" and "He hadn't got" are semantically equivalent. In some dialects one will be preferred over the other, and it is not unusual for reported speech to shift from a less preferred phrase to a more preferred version. To some, this will seem to be making it more formal, but really it's about shifting it to what fits "better".
I don't know what dialect or views of formality your question book (or worksheet or whatever) is based on, but your answer is just as correct, taking English as a whole, as the one in the key.
Now, if we take English back in time a bit, the key's answer might be considered more correct in general. But as it stands now, the two are interchangeable.