scriptcode, scriptsig, pubkeyscript confusion
The execution order is:


scriptSig/witness to construct the initial stack
scriptPubKey (which may invoke redeemScript evaluation in case of P2SH, and witness script invocation in case of P2WSH)


The scriptCode is simply a name for "the code being executed". Inside scriptPubKey evaluation, it is equal to the scriptPubKey. Inside redeemScript evaluation, it is equal to the redeemScript. Inside witness script evaluation, it is equal to the witness script.