In Sahih Muslim 1657b it says,
But he (Ibn Umar) said: You are free. He then took hold of something from the earth and said: There is no reward for me even to the weight equal to it. I heard Allah's Messenger (ﷺ) as saying: He who beats a slave without cognizable offence of his or slaps him (without any serious fault), then expiation for it is that he should set him free.
Now, Musannaf ibn Abi Shaybah 6/236 says
Anas reported: Umar saw one of our maidservants wearing a veil and he flogged her. Umar said: Do not resemble free women
My question is, is wearing a veil really a cognizable offense worth hitting slave girls for?