L = (UrToaESUN*cos(theta))/PI is correct expression, but you’ve written in other posts L = (rToa * e0__SOLAR_IRRADIANCE_For_band * cos(Z__Sun_Angles_Grid_Zenith_Values)) / (PI * U__earth_sun_distance_correction_factor)
perhaps it would be appropriate to correct