Their logic is the same as that of a bratty child having a tea party with their dolls and teddy bears, the ‘bad’ dolls who don’t follow the child’s tea party rules will get a spanking.
Out here in Reality, of course, we know that the dolls and toys aren’t doing or saying anything, right or wrong, but in the child’s rich imagination, their toys are doing and saying exactly what the child wants them to say, including ‘being bad’ so that the child needs to spank them.
It is no different in the adult narcissist’s mind; their victim is just a prop in their inner play-acting drama. No matter what the victim says or does, even if the victim says or does nothing, the narcissist’s inner mind is spinning out a tale, and if the narc decides that the victim must be punished for whatever he/she did (or did not do), then the victim is punished.
With a narcissist, there is no ‘lesson’ to be learned, because their rules and requirements change constantly. What they praised you for today, they will punish you for tomorrow, and vice versa. They are trying to push their victims into a state of accepting the narcissist’s reality as true, agreeing with the narcissist, doing what the narcissist tells them to do, and believing that they are bad or good, according to whatever the narcissist calls them in the moment. Which is all fine if you are a stuffed toy or a doll, but not acceptable since you are a thinking & feeling person with your own needs and emotions that are valid no matter how the narcissist tries to erase them.
The only real lesson to be learned is that the narcissist is a toxic person and it’s best not to go to their tea party.