It's difficult to fully diagnose what's going on without your HTML or study file, but I may be able to offer some insight. It appears you want to save the results on MaxDiffVersion to a variable of a free format question on the same page, is that right?
I would also note that the MaxDiffVersion function can only be used in MaxDiff tasks. It won't behave correctly in a non-MaxDiff question because the function can't be sure which exercise / task it is meant to be looking at. One trick we can do to get around this is by moving the <input> element that is meant to store this variable from the free format question into the MaxDiff task itself. It should look something like this:
<input name="ff_version" id="ff_version" type="hidden" value="[% MaxDiffVersion() %]"/>