Your intentions are not clear and without a MRE I don’t know how you got that error.
This code doesn’t give any error and it returns a label from a function:
// #let function() = <a>
#let function() = {
return <a>
}
#lorem(20)
Return label: #repr(function()) #function()
#lorem(20)