most probably, the internals are dirty, or rusty.
same thing happened to mine.
i didnt take the wheel off, i took the switch out, with internals, and then i took the outer hub off. cleaned all in solvent, (i used diesel), it was mainly rust that stop the internals sliding. make sure that the spring is in place, (connected to the spline ring, and the switch)
my spring also come off the spline ring, this meant that when it engaged, it would disengage.
make sure to grease it up properly, but not to pack it full of grease, as it wont work then. also, some people cut out a gasket/seal when replacing, but i found that was a waste of time, as any type of water crossing/mud will enter the hub through the switch.
this is something i do when i get my vitara serviced. engine oil, air filter, etc.
its straight forward. just do it.