In rP22526 have been changed message from MotionChanged to MotionUpdate and CMessageMotionUpdate::FromJSVal was not implemented to reflect changes in message structure.
As a result UnitMotionFlying tries to send MotionChanged message which not only was renamed, but sending it from js is not supported anymore.
I am not 100% sure, message implementation is the best solution, but I was not able to cast number to needed enum type.