I’d probably approach it differently since you are trying to store a duration in a column that is meant to hold a date and time…but without trying to change too much in your app, try this in your Diferencia math column. It will take the Lookup Horas, find the duration from midnight of the day you registered the schedule (which should result in a duration of just the hours and match your contract time), and then subtract that result from Presencia.
p-(d-(d-(hour(d)/24+minute(d)/1440+second(d)/86400)))