Maybe this will help make things clearer:
Scenario 1
Trainable params: 11M
Output layer: 1000 classes
Outcome: Model learns, doesn’t overfit.
Scenario 2
Trainable params: 5k
Output layer: 5 classes
Outcome: Model learns, overfits.
Scenario 3
Trainable params: 11m
Output layer: 5 classes
Outcome: Model doesn’t learn.
I don’t mind the trainable params, the questions is why does the ouput layer influences the learning.