Page 315 of the Collins English Usage reads
If you are talking about the past and you want to say that it was not necessary for someone to do something on a particular occasion, you say that they didn't need/have to.
I didn't need to say anything at all. Fortunately, she didn't have to choose.
However, in a reporting clause you can use needn't.
They knew they needn't bother about me.
If someone has done something and you want to say that it was not necessary, you can say that they needn't have done it.
I was wondering whether you were getting properly fed and looked after, but I needn't have worried, need I?
However, I cannot see any difference of meaning/usage between Didn't need to vs Needn't have done