apart from a small list of reserved attribute names (like @P and @N) you need to tell houdini what type the attribute is. Replacing @mypos with v@mypos should fix things
That's where I'm confused. In the first wrangle, I use v@mypos. From that point on, everytime I use @mypos, houdini should already know it's a vector, right?
No, Houdini doesn't do type introspection in wrangles (or in most places that touch geometry attributes for that matter), so for each fresh wrangle you need to define the types again.