Often get issues if you are miles away from 0,0...no way around it even if you know they have same endpoint....
try this lisp instead - much nicer - just set the fuzz to whatever minimum gap threshold you want (ie, for me (metric), it will join any lines whose endpoints are within 1/2 mm of each other). Eliminates all the extra steps of the pedit join routine as well
(defun c:pedit2 (/ ss fuzz)
(setq fuzz 0.0005)
(prompt "\nSelect Objects to Join Together.....")
(setq ss (ssget '((0 . "lwpolyline,polyline,line,arc"))))
(if (ssget "p" '((0 . "line,arc")))
(command "pedit" "m" ss "" "y" "j" fuzz "")
(command "pedit" "m" ss "" "j" fuzz "") )
(princ) )