dogs with kidney failure often have low calcium
levels, and this interferes with bone and joint function. Has your vet looked at the blood calcium
levels of your dog?
Phosphorus is intrinsically linked with calcium too, so in trying to reduce the phosphorus (essential for this illness), it can also cause issues with calcium levels.
Kidney failure dogs can also suffer from mild seizures. This is less likely the problem, but possible.
Finally, at 17, your best friend is a very old man.