AVG divides the sum of the recorded times by the number of measurements. In staging, one run took zero seconds and another has no measurement. Predict which of those runs counts towards the average.
Use AVG to return the mean duration_seconds for staging as avg_seconds. Keep the recorded zero and leave missing measurements as NULL.