I grabbed my well-used 40 year old Wingmaster 12 ga HD gun and an unfired, new production 870 20 ga Fieldmaster.
On both guns, when the action was all the way forward and the trigger was pulled so it was uncocked, the slide would move back roughly 1/2” before it hit resistance and started moving the bolt backwards to open the action. (Poor angle, sorry about that.)
View attachment 1172311
View attachment 1172310
When the action was locked firmly forward and unfired, on both guns the slide would move back roughly 1/16”. (Slide was slightly in front of 4” line, it moved back to the 4” line) The forearm does have some play side to side as well, so it feels “loose” compared to a semi auto or O/U shotgun.
View attachment 1172312
View attachment 1172313
The slide on a nice used 870 can move back a half inch from gravity alone if uncocked. If it was fully forward and cocked and still slid back 1/2”, then I would think something isn’t quite right with the gun.
If it does move a lot when cocked, there may be an issue with the bolt not locking up correctly or maybe the areas where the action bars-bolt fit together could be worn.
I recommend a good breakdown and complete cleaning first, paying close attention to the parts in the bolt. (You Tube is your friend here!) If it still does that after being fully checked, cleaned and lubed, have a good gunsmith check it out before you fire it, like
@Big7 posted above.
Stay safe.