Unlink two layers after a certain time in After Effects
valueAtTime returns the keyframed value of the property, before any expression is applied.

change it to:

p = thisComp.layer("Leader").transform.position;
t = 1; // Stop following after 1 second
if (time &lt;= t) {
    value + (p.value - p.valueAtTime(0));
}
else {
    value + (p.value.valueAtTime(t) - p.valueAtTime(0));
}


or more simply:

p = thisComp.layer("Leader").transform.position;
t = Math.min(time, 1); // time increases until it hits 1, then stays there
value + (p.value.valueAtTime(t) - p.valueAtTime(0));


This avoids the if() statement which means it should evaluate faster.