Treating data points that belong to several categories in regressions

Assume a simple linear regression model with varying intercepts and slopes:

y_i = a_{category_i} + b_{category_i}*x_i

I have a dataset with one continuous predictor (x) and one categorial predictor (“category”). Let’s say 2 categories. I want to infer a1, a2, b1, b2.

How should I treat data points that belong to both of these categories?

I don’t see where you have a main effect for b. Lack of main effects does not respect the hierarchy principle and will make the result very dependent on the coding of x.