Unable to convert Surface to Brep Geometry?

This means that your Srf variable is not a surface or brep, it is None (i.e. it is nothing/null). So backtrack upstream within your code/definition to where this surface comes from, and try to figure out why it is None (properly the method/component that generated it failed and returned a null/none).

Edit: Make sure to internalise your geometry inputs in your definition, and also format your code in your post to make it more readable. Both helps tremendously with troubleshooting/debugging .