If we give the same email in TO, we are getting duplicate emails. but it is working fine in the older version (4.0.4).
We analysed your code and found the reason.
Previously we used the switch message "getTo" function. So that function handled duplicate emails. Please see the below screenshots
https://prnt.sc/y03OuEG64wBU
https://prnt.sc/ccKrF6fHQV1O
Now we are using our own "getTo" function. we didn't remove duplicate emails
https://prnt.sc/6G3ZUophwTcn
https://prnt.sc/YwRHZ8P-4B7E
So kindly fix this issue in an upcoming version. Thank you