I had these issue too sometime. Also using nodemcu or similar boards.
As this got annoying and because its also much faster I’m flashing OTA (using ArduinoOTA) now and use serial connection only when I brick the OTA code.
Sure this is only a workaround but it’s working great and OTA is nice to have anyway.
Problem is, that it sometimes appears and sometimes not. Maybe it’s even a hardware issue - at least once it did appear continuously with one nodemcu board, but not with an other.
But at the end it looked more like a problem with the esptool to me then with PlatformIO. I’ll try to reproduces this later this week.
This problem shows randomly, hence, is difficult to debug it. It only happens me with PlatformIO and NodeMCU. Maybe the esptool in the bundle is not the latest version?