I learned this the hard way too.
The pipe on my old race quad had the end cap come loose a bunch of times but it never fell completly off.
I drilled new holes to rivet it back on and also jb welded it into place after it came loose a few times and it lasted for alot of years since and is still holding together without issue... most people dont know this but you never need to remove the end cap to repack the can. You only need to drill out the rivets in the front of the can where it hooks to the mid pipe and pull it apart there, I always see how to repack your muffler post with the end cap removed.
Geting water in the can causes brand new packing to burn right up too, this was my issue cheap packing was only lasting untill the first deep water crossing lol try to avoid getting water in the can.