"Why did not you do sth" is not grammatically wrong, but just sounds weird, instead you should say "why didn't you do sth".
"Why did you not do sth" to me is the exact the same as the previous one, however when you say it, you put the emphasis on the NOT part.