I agree with LionelHutz. It would be better to have the relays downstream of the smaller breakers.
However, as far as violating code, you might be OK. Assuming the small conductors you are worried about are not more than 3 m long, they don't leave the panel, and they are rated correctly for...