I had this problem as well, particularly on subsiding roadways and in heavy cross winds. Some said it was the drop in liner, so I had a spray in liner done - same problem still, no change. Plywood, rubber mat, etc. I have only about 1" clearance on each side of the camper in the tailgate.
Finally I made this. 1/2" plywood cut for a snug fit between the wheel wells and tailgate. Low rails to capture the camper, about 1/2" clearance on each side if perfectly centered. It sits on the liner (spray in on the truck in the picture, drop in in the new truck, it makes no difference). On top of the plywood is a 3/8" mat rubber mat, this is mostly to protect the plywood from getting eaten by the bottom of the camper. I painted it with polyurethane after this picture.
It took 3 sheets, as I did the front piece crossways to fill the space ahead of the wheel wells (although that is not really necessary). Then two pieces side-by-side in back, extending 8" over the end of the bed to ease the hard edge of the bed. Those drop in and are locked by the notch for the tailgate, so they cannot slide any direction. Three pieces makes them small enough to install, remove, and store easily.
The camper never moves.