As it currently stands, a required field is always required, even if dependent. Therefore, if you set a dependent field to be required, the user gets a "missing required field" error even if the field dependencies have not been met and the field is not visible in the layout.
I suggest changing this. If it's a dependent field, then by default it should only be required if it's actually visible in the layout. This seems like common sense, and it would mean one less thing that requires back-end coding to fix.