Here is my code:

// Main Variables in the model
public static VariableArray<double> workerAbility;
public static void Infer(int[][] taskIndices, int[][] workerLabels)
{
int workerCount = workerLabels.Length;
AttachData(taskIndices, workerLabels);
Engine.NumberOfIterations = NumberOfIterations;
workerAbility.AddAttribute(new Sequential()); // needed to get stable convergence
taskDifficulty.AddAttribute(new Sequential()); // needed to get stable convergence
// Get the compiled inference algorithm
//var ca = Engine.GetCompiledInferenceAlgorithm(workerAbility, taskDifficulty, discrimination, trueLabel);
workerAbilityPosterior = Engine.Infer<Gaussian[]>(workerAbility);//Error thrown here
}

While debugging, I found the error to be thrown here:

Not quite sure what I might be doing wrong here? Where does that "value" in prob[value] come from? In the above code, Dimension=4, but "value" changes from 0 to 1 to 5. Not quite sure how this is happening and if what I am doing is actually
the right way to infer Gaussian distribution ( I must be doing it wrong if there is error though haha)

please advise