Hi Mogn,
Your divide scalar node won't give the result you want, because divide scalar expects both inputs to be scalars. If any of its inputs are vectors, they are converted to scalars by using the length of the vector, so you lose the vector information. In your example the result of the divide scalar is then converted back to a vector for the dot product node by copying the scalar into each component, which gives the wrong result.
What you want is divide vector. It's OK for one of its inputs to be a scalar.