You need a return statement in the unverified Perl section otherwise the difference will be 0.
It should look like this
[% begin unverified perl
return VALUE("leadercbctime2_2") - VALUE("leadercbctime1_beg");
end unverified %]
Assuming those are freeformat hidden variables it should work.