Recursively validates menu items at a given depth.
The menu items to validate
The current nesting depth (0-based)
PlatformError with code INVALID_ARGUMENT if validation fails
Recursively validates menu items at a given depth.