When the routine was declared, it did not contain a RETURNING clause to indicate that the routine would not return any value, but then a RETURN statement was found in the body of the routine.
An example of the error follows:
CREATE ROUTINE testproc() DEFINE a INT; LET a = 10; RETURN a + 1; -- error END ROUTINE
Correction: Add a RETURNING clause before the DEFINE statement, or remove the RETURN statement.