Make me to hear joy and gladness; that the bones which thou hast broken may rejoice. Psalms 51:8
The broken bone spoken of here is an illustration of the act of a shepherd toward his loving sheep in Israel of old.
Among the Shepard’s flock, there were at times a sheep or a lamb which constantly wanders from his presence, while exposing itself to danger.
The Shepard will make the decision after rescuing the lamb from danger often times. He will take the leg of the animal in one hand while holding his staff in the other hand, with swiftness he brings down his staff upon the foreleg of the beloved sheep, breaking its bone.
Thereafter, he will carefully bind the leg for the healing of the bone. From there onward, the Shepard will take the lamb in his arms and in his bosom, wheresoever he goes. As the lamb bone heals, the lamb will become accustomed to the care and protection of the Shepard, thereby developing a bond with the Shepard.
After its broken bone is completely healed, the lamb will no longer wanders from the protection of the Shepard.
Likewise, David the writer of the Psalm has liken his life and the errors of the past to the broken bone of the lamb by the Shepard.
At times David, early in his life wanders from the presence of the Lord by doing that which he ought not to do, whereby placing himself in danger.
Consequently, David was brought to a place wherewith, he was helpless like a lamb with broken leg, but dependent on the Lord he became.
Nevertheless, David is saying poetically, some of my troubles were my fault, but even then, the broken bone I experienced was of joy and gladness because it brought me closer to the Lord and kept me from danger.