Hi Logan,
It seems to me that your latex isn't properly formatted so that the calculator can understand it. I believe the following is happening: Desmos is parsing the distance function not as a function, but as a bunch of variables multiplied together and (original, second) as a point, not parameters of the function. Selecting the expression and moving the cursor, or modifying the expression makes Desmos normalize the latex. This causes it to realize distance is in fact a function . Can you try changing the calculator.setExpression line to use the following latex:
`o_{distance}=\operatorname{distance}(${original},${second}})`
Note how distance is replaced by \operatorname{distance}. This makes it clear to desmos that distance is a function.
Please let me know if this fixes it!
Sincerely,
Vincent van Doordrecht