I tried changing the serial cable but still, I am getting the same output in Platform IO.
When I tried uploading the code using Arduino IDE, it worked flawlessly.
I think it’s Platform IO specific error. I’ll get in touch with them.
Thanks for all the help Pete. Much appreciate it