Deployment modes can change anything (though it's not necessarily recommended).
If it helps, think of it as a single project inheritance tree. If you're in the dev mode, you're consuming external -> system -> core, then whatever dev defines, and then potentially overridden by anything local:
Then if you switch to test you're using a totally different set of resources:
And if you started your gateway without a deployment mode, all your modes are ignored: