Component Wise Dirichlet BC

You would need to add a complete minimal working example that reproduces your error for anyone to be able to help you.
See for instance:
https://jsdokken.com/dolfinx-tutorial/chapter3/component_bc.html#boundary-conditions
and