So the part of your bike that you're looking at is this:
View attachment 4564
#4 goes inside the swingarm right where the axle nut is, #5 is the end cap you're referring to as loose, #11 is the adjustment nut and #13 is the locking nut to stop it backing off on its own (#13 is tightened against #11 when you're locking everything in place).
What you have here is a sort of plug situation with the end caps and #4, which looks like this:
View attachment 4565
When you loosen the bolts on the axle that normally goes through F-19-20 (14mm and 19mm wrenches), that eases the grip on the outer plates on the swingarm. When that happens, part #4 moves freely when the axle bolts are loosened, which allows #5, #11 and #13 to all move backwards. That rattling is #5 being loose.
If you pulled the wheel all the way back and tightened the axle bolts, the chain would be insanely tight, and the end caps would hang freely, and despite having done the bolt adjustment steps right you'd actually have an out-of-spec chain tension. To resolve it, when you adjust everything, you should push the entire wheel forward on both sides. Make sure that the end cap sits nicely inside the swingarms flush with the ends. Move the wheel as far forward as you can, check everything is flush, tighten the bolts enough to hold it in place, and check the chain tension. If the tension is good, tighten the axle bolts to spec checking that nothing moves (I continue to prop the wheel forward until I'm done), and then call it good. If something moves around, loosen the 14 and 19mm bolts and start again.