I get the exact ame error when I use the VScode Platformio IDE.
I see this error if I hover over the underlined error:
Interestingly, if I change it to PIN_PA1 and select “Go to Definition”, it opens up C:\Users\user\.platformio\packages\framework-arduino-megaavr-megatinycore\variants\txy6\pins_arduino.h which is exactly the header file I expected.
If I look through the file I clearly see the #define for PIN_PB5!?
Then there must have been either a corrupted download or a local modification to one of the deleted folders.
Tell-tale sign of wrong oscillator / clock frequency. Depending on the Fuse settings burned into your ATTiny1616, it will try to use its internal oscillator or an external crystal, divided by some prescaler. Right now your config compiles the code with the expectation that the ATTiny1616 is set up for a 16MHz clock.
If this assumption is wrong, then the UART frequency will be off.
Try setting the monitor_speed to double, half, an eigtht or times eight the baud rate you set in the code. The actual baud rate will then give you the factor by how much your clock frequency is off.