南辕北辙
nányuán-běizhé
to act in a way that defeats one's purpose (idiom)