How to add weights and constrains to Multilevel model

Your first plot shows that the data for x is between -10 and 10, your second plot goes from -100 to 100. It looks like the condition might hold for x in [-10, 10]. You’re probably asking too much of a linear model to extrapolate outside the range of your data.

The weights can be incorporated as

for(i in 1:N){
  mu = intercept + intercept_x2[ GROUP_ID[i] ] +  beta*x[i];
  target =+ normal_lpdf(y[i] | mu, sigma) * weights[i] ;
}

See also Survey weighted regression

Have a look at the truncated or censored data section in the Stan Manual on how to implement the constraint.