I don't agree with your conclusion, 'then our knowledge of how mechanics and gravity work must be seriously flawed.'
OK then, let's look at things from a very fundamental level. As I understand your project, you are attempting to build a machine that runs on gravity. In other words, with no other source of energy than gravity, your machine (if successful) will make at least one complete cycle arriving at the starting position with all pieces in the same location as when started.
Now lets consider two fundamental laws of physics:
First off, there is the law of conservation of energy. This law states that for any closed system, energy is neither created nor destroyed. If you believe this law applies to the universe, then your machine must get energy from someplace. I believe you are attempting to tap gravity for that source.
Since you are using gravity as your energy source, we need to consider the law of gravity. This law states that every object attracts every other object with a force that is follows the equation: F = G * m1 * m2 / r^2 where G is the universal gravitation constant, m1 and m2 are the mass of the two objects, and r^2 is the square of the distance between the two objects.
As far as my knowledge of physics goes, the force of gravity between two objects some distance apart is absolutely constant. so long as the mass and distance do not change, the gravitational force does not change.
Now, assuming that your machine works as intended, it gets energy from the force of gravity between the earth and the various components of the machine. Because of friction, it dissipates some energy in the form of heat which is energy lost to our ever present friend Entropy. Eventually it arrives back to its starting position ready for another cycle.
Since energy cannot be created, the machine MUST extract energy from gravity at least equal to that lost to friction. Also, since energy cannot be created, we can only conclude that your machine has slightly decreased the gravitational force between the earth and your machine. This would seem to contradict the law of gravity.
Since your machine is at its initial state, the distance between each component and the earth will not have changed. So, the only way to balance the gravity equation would be for the mass of the earth and/or your machine to have changed. Barring some kind of subatomic reaction, a given substance does not change its mass. Certainly we have no evidence that substances change their mass in response to a system of wheels and weights moving about.
Since we have no other explanation of why your machine would work, we would have to conclude that the law of gravity was incorrect. Hence, our understanding of how mechanics and gravity work would have to be seriously flawed.
As an aside, I would be afraid to run a machine that really did operate off of gravity. Since energy cannot be created, wouldn't large scale use of such a machine put us in jeopardy of one day floating off into space as the gravitational energy is eventually exhausted???