Everything works fine on the viewport and on the Motion Tracking Menu tab. I have a solve error of 0.839 and 26 trackers. If I do a viewport render, there's no problem. However, when I do a normal render (either in eevee or cycles), the objects start moving around unpredictably as if not recognising the motion tracking. I would really appreciate it if someone could help :)
It is impossible to help with motion tracking without looking at the shot, and the nodes used on the compositor.
A few comments:
An error of .8 pixels is still too high, you should aim for an error of .3 or lower.
Use the graph and dopesheet to see if any trakers have a high error value.
The most common error in tracking happens if you try to use the default solver on a shot where the camera is not moving, or where the camera is stationary and just tilting and panning. Those shots can only be solves as "tripod". And will not give you any 3d information.
If you haven't already please read the detailed post on this site on motion tracking: