That's pretty close to my understanding but I believe it is a bit more complicated than that.
First, the biological evidence as far as I know is that pyramidal neurons in different layers behave differently. In layer 3 the evidence suggests that simultaneous activation of apical and distal dendrites is not capable of causing the cell to spike. In layer 5a the evidence suggests the it is possible to generate a spike by activating both apical and distal dendrites.
I have a theory for why this is. Activity in layers 4, 3, and 2 always reflects sensory input. If these cells are firing that means something is really happening in the world. If layer 3 learns sequences we don't want it to be active if no input is occurring. That would be like an hallucination. Predictions in layers 4 and 3 are always represented by depolarization and therefore you are not consciously aware of these predictions. Only if the input doesn't match the prediction will you be aware of the discrepancy.
Layer 5a is the motor output layer of the cortex. When we generate motor sequences, layer 5a cells are the ones doing it. Learned motor sequences need to go forward on their own. As a motor sequence plays out the cortex verifies that the expected result occurs but the motor sequence itself cannot be driven by sensory input. E.g. imagine speaking a word. Your layer 5a cells drive the voice box but they need to do this before hearing the results of you speaking. This is why layer 5a cells need to be able to play back sequences on their own, without proximal input. L5a cells need to learn motor sequences and they do using their proximal synapses, but unlike layer 3, then can play back sequences without proximal input.