I thought I would include the solution here, just incase anyone would benefit:
The issue was that X wasn’t vectorising as I had assumed in the model code. I needed to explicitly create an X for each measurement:
X = Vector{Real}(undef, Nx)
for i in 1:Nx
X[i] ~ Normal(mean_X, sd_X)
end
and then reference that particular X in the likelihoods:
for test_A_id in eachindex(test_A_data)
test_A_data[test_A_id] ~ Normal(X[test_A_id], test_A_error)
end
…where
Nx = max(length(test_A_data), length_test_B_data))