I ran into a build issue recently because one of our build scripts changed, so a now-vestigal directory was causing problems because it was no longer being cleaned up. the execution was
Jenkins runs old-build-script clean which cleans foo/lib
Jenkins runs old-build-script build which creates foo/lib and populates it
build script change is checked in
Jenkins runs new-build-script clean which no longer cleans foo/lib
Jenkins runs new-build-script build which no longer creates foo/lib, but the old content is there.
The only real workaround on my end is to always be vigilant for all possible places that code could possibly affect my build and preemptively clean them in all cases, regardless of whether I'd place anything there. That puts a huge burden on me.
I just came here to report this very issue.