Imperative Code Block not working

I frequently use Imperative code blocks to do some of the more laborious tasks in Dynamo. Using the node-to-code feature is nice if I want to use a function already defined by a node. This has worked well in the past but I’m having trouble using Elements.Element.ElementType in Imperative blocks. See attached. Does anyone know why this may be causing a ‘null’ return?