Welcome to the world of TBN. The place for answers and advice for Yanmar tractors.
I suspect that your shifter is like the picture Winston posted. The shifter linkage controls a spool valve ultimately, but there is a bit of connecting elements before that happens. Any of those elements or the spool itself could be causing your troubles.
I would begin at the top and work down piece by piece until I found the problem. What I suspect is that 1) something has broken and is putting the linkage in a bind. (I had a problem getting mine to go into reverse, when I took the linkage apart I discovered that a 3/16 pin was badly bent and sloppy. This extra slop prevented me from moving the lever far enough to get the detent of reverse engaged. I replaced the pin with a hard bolt and all is well.)
2) There could be a bit of crud in the spool itself which is prohibiting the movement. (I had a problem with the transmission not engaging--I took the top off and the tiny pin hole in the side of the relief valve had some crud in it. But I had the whole thing in my hand. your problem is there in the top it is simply a matter of identifying it.
It is not very difficult to take the top off and inspect the parts individually. Just be very careful not to drop anything into the case--little balls that ride in detents pushed by stressed springs love to jump out and then hide from you.
I had to create a little puller to actually pull the relief valve out, but it was not difficult. I can scan a page of the manual if you need it.
Mike