Probably is just down to washers, although it depends on the frame. If you’ve changed the bearings and not put the washers back in, it will not allow the shock hardware to tighten up properly against the links/hardware, causing play.
I came across this with a bike recently, in an almost identical situation. An apparently trained and experienced mechanic had replaced all the bearings in a frame and couldn’t get rid of the play in the back end, despite putting in new shock hardware, bolts etc. Turns out he’d simply forgotten to put the washers back on behind the head of the shock bolts, meaning that they were fully tightened before they were able to bind the whole area together. This was on a cheaper Mondraker frame (a Tracker to be precise) which doesn’t use threaded holes in the upper and lower linkages.
Best bet if you’re unsure is to take it to your nearest decent bike shop. It’s probably a very quick fix.