Try eliminating all nightshade veggies from your diet along with grains and see how your body responds. I deal with RA. While potatoes do not give me any problems, the only grains that my body tolerates are corn, quinoa, and buckwheat. From your description, you may be dealing with an autoimmune disorder of some type such as RA. You will probably need to continue to experiment with various foods to determine your personal food triggers. It would appear that you already know your body does not tolerate potatoes or rice. Just be aware, any food is suspect for causing a problem until you prove otherwise for your body. What I can eat could cause you extreme problems while foods that you can eat without issues could put me in bed. You just need to keep experimenting with various foods to determine what your body will tolerate.
Have you see this article by Dr. McDougall?
https://www.drmcdougall.com/health/educ ... arthritis/
Also, here is the link to Dr. McDougall's Elimination Diet information:
https://www.drmcdougall.com/health/educ ... s-to-food/
But, again, remember just because a food is listed on the Elimination Diet does not mean your body won't respond adversely to one of the foods listed. When following an elimination diet, I went two months without much relief. Then decided to eliminate all rice and oats. Received immediate relief almost overnight when I eliminated those two grains. Had previously eliminated any and all foods containing gluten which helped a lot but did not completely resolve my issues.
It can be a long process to identify all your personal food triggers but well worth the effort to finally experience good health.