Using global span you'll have:
extra cost = ( max(all vehicle end) - min(all vehicle start) ) * global_span_cost_coefficient
according to what you said and few hypotheses
max(all vehicle end) = 24
min(all vehicle start) = 0 # supposing vehicle start distance dimension at zero aka force cumul start to zero is set to true
global_span_cost_coefficient = 100 # since you are using distance_dimension.SetGlobalSpanCostCoefficient(100)
so we have:
extra_cost = ( 24 - 0) * 100 = 2 400 added to the objective value
For penalty since the vehicle is empty it should have a counter dimension equals to 1 at the end node, and according to the SetCumulVarSoftLowerBound(index, 2, 100_000) in my above message
extra cost= max(0, lower_bound - cumulvar value) * 100 000 = max(0, (2 - 1)) * 100 000 = 100 000 added to the objective value
For the 24 my guess is: you are using the method "routing.SetArcCostEvaluatorOfAllVehicles(distance_transit_callback_index)" so the sum of all visited arcs aka vehicle routes is also added to the objective.
You have an empty vehicle i.e. 0 and a vehicle whose distance is 24 thus the sum of all arcs should be 24...