Hi, chastened by my learned teacher davido for my earlier unhelpful reply, I performed penance and installed VirtualBox and a Windows 10 VM and Strawberry Perl (64-bit). I'm running Strawberry Perl v5.30.1; Email::Valid v1.202; Net::DNS v1.21; Net::DNS::Resolver v1740, all of which came with Strawberry. I tested your original code and it worked fine. Could not reproduce your issue: all behaviors as davido reported in his reply to your OP.
Sorry cannot be more help!
The way forward always starts with a minimal test.