I think babies are very clever, they would find a person who never punish or shout at them. Maid don't teach them but parents do.
In my case, my maid is not too good to my baby but my baby still wants her always and doesn't approach me whenever I punish or shout at him. At last, I found a solution.
I ask my maid must stand at my side (that means ask her not to be the one to comfort the baby and do nothing for the baby) when I'm teaching or punishing my baby. Then when my baby approaches my maid later, my maid ignores him then. It really works! I'll let my baby cry for a long time (after he knows nobody help him). Until he is tired and calms down, I shall go and comfort him and make him sleep. He then kisses me and willing to sleep with him. Before he only allowed my maid to sleep with him whenever I punished him.
I think it just like mom and dad. Somebody would say one parent should pretend to be kind and another one should pretend to be strict to children. But at last, children will approach the one who are not strict. Therefore, I think it's very important for both mom and dad to stand at the same side so that you can teach your children successfully.