Common issue. Those rivets that went “flat” needed a shim between the skin and the rib. The rule is “if you can fit a shim between the skin and the rib, it needs a shim”.
You can make shims out of 0.032” down to 0.020” aluminum. Drill your #40 hole and dimple. Cut into squares ~3/4” on each side. Insert between the skin and the rib and rivet.
Some have had success with “tapping” the tail of the rivet with a small peening hammer. There is risk involved doing this and it may not get you the results.
Shims are best as Carl mentioned.