The chain sprocket here is supposed to rotate the keyed shaft below. At some point the 1/4" sq key came out. Instead of replacing the key, someone decided to try to just tighten the tiny set screw in the sprocket until it bottomed out on the keyway floor. It didn't end well and the keyway got trashed.
I cleaned up the keyway and installed a new key.
Then I milled a 1/4" slot into one half of a split shaft collar, and installed the collar over the part of the exposed key where the keyway in the shaft was damaged. Finally I installed a regular split shaft collar to butt against the end of the new key to keep it from backing out again. Final pic