Windows from spaces

This is an interesting solution, thanks for the pointer!
When I use the code block you sent out, I get an error and it comes out null. I’m only selecting one space for this example but am I doing something wrong in the syntax that I can’t see? The error coming up says “Null value cannot be cast to Double”