You need to manually move the point in your function like this:
(defun mouse-test (event)
"Move the point to the clicked position and message the thing at point."
(let ((es (event-start event)))
(select-window (posn-window es))
(goto-char (posn-point es))
(message (thing-at-point 'word))))
Do C-hfinteractive to understand how the argument
event is given.
Also look at the function
event-start for documentation about what info you can retrieve from the event parameter.
A function bound to mouse events will not move the point automatically, the function needs to do it.
The reason your function works with
[mouse-1] is that you are actually running two functions but don't realize it. When you do a normal mouse click both the functions bound to
[mouse-1] are run in that order. The default function bound to
mouse-drag-region which sets the point.
However doing a shift click (
[S-mouse-1]) does not run
[down-mouse-1] so it does not set the point.
Run C-hk then click the mouse and you will see the docs that describe the behavior of