VSC PIO - why it does not update upon code change before build?

This problem persists.
I edited and built the same project using the status bar icon.
The build output appears in the console, with new errors.
I commented out the errors, and re-ran the build, and the newly generated output has the same errors.
The file saved on disk has been changed, with the erroroneous code commented out.

How is the old code persisting? Surely PlatformIO calls the arduino build process passing references to the files on disk?

Update - some further information:
My project does have an additional folder called ‘libs’ in the same folder as the src, with source code in it.
During the build, in .pio several temporary folders are created with variations on ‘libxxx’ containing the compiled .a files.
It appears that changes in the source ‘lib’ files, as compared to the ‘libxxx’, are not being detected and they are not recompiled.

It does appear running a ‘Clean’ does delete all the temporary folders, and a following Build then compiles everything correctly.