Page visit recorded seperatly for Matomo default tacking code and Tag Manager Code for single page visit - Duplicate Unique Vistor

Hi, I have embedded the matomo tracking code(at the end of head part) and matomo tag manager code(after opening tag) in the same page(index.html).
The visits and events are captured as two seperate unique visitor records.!!!
Resulting in total unique visitor records doubled, Have someone faced same issues? Any fixes.

Note : Updated to latest matomo version - 3.13.3 (Got error in old and latest version too)

Check the attached image.
Thanks in advance!!