Errors like "Unexpected nil value returned from the get_sample() function instead of .. channel" would be much more meaningful if we had the coordinates from first encounter.
Often the error is only caused by a part of the the script, and the rest of rendering shows up just fine. If the error message was appended with "(x: 0, y: 0)", it would be easier to debug..