fix(next-core): throw on invalid metadata handler (#62829)
### What
Align with original route loader, explicitly throw on invalid handler
import.
This does not fixes test currently - other failures on the specific test
need to be solved.
Closes PACK-2652