You can think of LDAP as a tree (example). Thus, `ou=example,dc=hostname1,dc=people` will traverse the tree starting at the root `dc=people` and passing its child `dc=hostname1` before arriving at `ou=example` as a child node of `dc=hostname1`.
If you mix that order LDAP isn't able to traverse the tree. In your second example it will struggle finding the root element `dc=example` and you'll just get a message telling you that there is no such path in your directory tree. (check your logs.)