It means to take a (flawed) existing solution/explanation to a problem and modify it in ever more convoluted ways to make it work when the current version fails.
It comes from pre-Newtonian times when there were people working on a theory of orbital mechanics, thinking that orbits were circular rather than elliptical, and every time someone made an observation of some moon that the theory didn't handle, they bolted on a bit more math to try and account for that observation.
It was "working on circles" or "calculating orbits" or something like that.
Best Answer
It's known as adding epicycles: