That law was added when guns were so imprecise it was difficult to hit the broadside of a barn from inside the barn.
That's blatantly false. Timothy Murphy killed a British officer during the Revolutionary War at a distance of 300-400 yards. They absolutely had the capability of precise marksmanship at the time the constitution was written. Repeating rifles were not a foreign concept either. They weren't common yet, but there was no reason for them to believe the technology wouldn't be improved.