Hi, Phillipp.
You can start with CREATE PROCEDURE statement in SQL Console. It will give you a row number where your code is incorrect during the execution of the statement.
To simplify your investigation try to define a scalar output parameter in order to make things easier and set it to some constant (then you will be not abused by structured output parameter). Then you can change your calculation logic line by line in order to find what is the problematic object in that line and why your code is incorrect.
Regards,
Andrey.