Thanks, I missed that they were trying to write their own DNS server. Yes, that's much more complicated than it seems like it should be. But you're in good company, there are other people who recently have had problems with their old or homebrew DNS servers not quite following the standards:
I've spent a few minutes trying to find the spec that says what should be returned for a NOERROR empty response, and that it should include a SOA record, and I don't know the chapter and verse since there are a lot of DNS specs over the years. But it seems to be a thing that's expected, and that current resolvers require.