Yes, and much more skillfully than a layman.
That is very correct. I read of a case of a psychiatrist in the US who beat his wife and children to death with a baseball bat. He was certified insane, and spent only a short while in facility before being 'cured' and released. Writers on this case have suggested he feined mental illness and feined recovery. He had all the background for it.