PPC for data with known measurement uncertainty

Sorry, maybe I didn’t say it clearly.
The measurement error is not a constant,
and here X_obs, Y_obs, and Y_err are all array with the same shape.
In model_y, I need to pass the individual measurement error (Y_err) value to each sample,
that’s why I need to use shape=len(X_obs).

If I use

Y_max = pm.Uniform('Y_max', lower=0, upper = X_shared * a + b)

the line will return the error message

TypeError: For compute_test_value, one input test value does not have the requested type.

The error when converting the test value to that variable type:
Wrong number of dimensions: expected 0, got 1 with shape (50,).