>>Were you pedalling hard? Yes
Ease up on the pedalling force as you shift any gear. Shifting the chain under tension is not good for your transmission.
BTW, riding with a heavy back pack is not good for the rider. If this is a regular thing, take a look at luggage racks. The extra weight is negligible, but the bike will take the strain instead of your back.