It is especially sad that your dog was alone when he died but I doubt he suffered very much since following orthopedic surgery, extended release pain medicine, such as a
Fentanyl patches are used, as well as other strong pain medications. Lastly, there may have been microscopic metastasis, not visible on X-Rays or in blood work in your dog, and if so he may have suffered a long recuperation for little benefit.