Basically, Sub() is a shortcut for Function() as Void. Staring from the docs
The statement "Sub" can be used instead of "function" as a shortcut to a function of Void return Type.
To exit early, you have some options. You do not need to have a return value (you can't) if you use Sub() or Function() as Void. If you don't specify a type, Function(), or use Function() as Dynamic, then you can return anything you'd like, but you must return something (invalid or not). If you do expect to always return a specific type, e.g. an integer, then use Function() as Integer, and return with valid integer.