Co-authored-by: Nate Moore <nate@astro.build>
Improve error handling when top-level return is present
return