The presence of illegal objects in pspicture will make legal objects that follow get distorted.
The left picture demonstrates a case when there is no illegal object. The legal object (a dot) that follows is placed exactly at (2,2) as expected. But the right picture shows the opposite, the dot gets displaced to the right because of the presence of illegal object.

\documentclass[border=15pt]{standalone}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}[showgrid](-1,-1)(3,3)
%illegal-objects
\pscircle*(2,2){2pt}
\end{pspicture}
\quad
\begin{pspicture}[showgrid](-1,-1)(3,3)
illegal-objects
\pscircle*(2,2){2pt}
\end{pspicture}
\end{document}
Edit
Or you can use % to disable the illegal-objects, duplicate the illegal-objects, and wrap it with \rlap as follows.
\documentclass[border=15pt]{standalone}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}[showgrid](-1,-1)(3,3)
% illegal-objects
\rlap{illegal-objects}
\pscircle*(2,2){2pt}
\end{pspicture}
\end{document}
$\sqrt{40-x^2}$is not a pstricks command, whichdoes not know what to do with this stuff, so it\rputs it at the origin. This being said, do you really need\psplotto draw a half-circle? – Bernard May 29 '19 at 12:31