If I understand you correctly, you want to redirect everything to 127.0.0.1. In that case you should be rewritting only resource records with type A and nothing else. If you overwrite the other types the data format will not match and it will cause problems either in resolver or on client side.
I would recommend you to modify code to go though all RRs in answer and to re-write only type A RRs in place.
Similar thing can be done for AAAA type (using appropriate data format).
It should produce answer which has all non-address types like CNAME, MX. etc. intact but all IP addresses will point to your sinkhole.
www.example.com. CNAME target.example.com.
target.example.com. A 127.0.0.1