You said: The word ‘commanded’ is past tense. Therefore, Jesus had already taught the disciples ‘all things’ which Jesus commanded to be taught. QED.
Yup. And as John indicates in his gospel, not all of it was written down. Therefore since we are to observe them we have to get those not documented in scripture from another source.
And has been pointed out, John was referring to things Jesus had done. Matthew is referring to things Jesus commanded to be taught. Just because one is infinite (or at least so much all the books in the world could not contain them) does not mean the same apples to the other. They are TWO different things. And clearly Matthew states that Jesus had already taught them all things that they are to teach, which most definitely must be more finite (sorry for bad math analogy) or the disciples would have an impossible task.