I currently get the below error message when attempting to populate default values from an external validation API. I'm merely attempting to update specific fields, running the below code in the init() of the Contract Entry form, and then doing a BRKContractHeader_ds.executeQuery() in the init() of the datasource on the form to get these passed in default values to populate the respective fields. Any suggestions on what is causing the error?

Below is the code I'm using to implement these default values, specifically line 23.
public void ApplyInstructions(BRKFormDataInstructionCollection instructions)
{
BRKFormDataInstruction fieldInstruction;
DictTable dictTable;
DictField dictField;
dictTable = new DictTable(_tableNumber);
var fieldId = dictTable.fieldNext(0);
while(fieldId)
{
dictField = dictTable.fieldObject(fieldId);
if(!dictField.isSystem())
{
fieldInstruction = instructions.getInstructionForRecordField(_tableNumber, fieldId);
if(fieldInstruction != null)
{
_dataSource.object(fieldId).mandatory(fieldInstruction.isRequired());
_dataSource.object(fieldId).visible(!fieldInstruction.isHidden());
if(fieldInstruction.getDefaultValue() != null)
{
_dataSource.object(fieldId).setValue(fieldInstruction.getDefaultValue());
}
}
}
fieldId = dictTable.fieldNext(fieldId);
}
}