If your Windows PATH environment variable in your VSCode terminal does not match the one in your terminal outside of VSCode, it’s probably this setting in VSCode:

terminal.integrated.enablePersistentSessions
Uncheck this or set it to be false, and restart VScode and all should be right.
By default, this option persists your terminal sessions across reloads (VSCode Terminal Advanced Docs).
That might be handy, so re-enabling it afterwards would be okay if you really wanted it, but for me I’ve disabled it in my user settings:
"terminal.integrated.enablePersistentSessions": false,
I also changed “Terminal: Integrated Persistent Session Revive Process” to “never”:
"terminal.integrated.persistentSessionReviveProcess": "never",
I noticed this issue when I was installing Ruff.
I’d installed Ruff using UV, and set the path in a terminal outside of VSCode.
Using the handy utility JustPath, I can see the PATH has been updated:

When I went to VSCode to try out Ruff, I instead got this:

The PATH is different and it turned out the Terminal enablePersistentSessions default setting was the reason.