In the America's cup we are talking about the absolute refinement of the sloop, not the case in 1812, the Frigate could put guns on the sloop, because no ships captain would be chasing from dead astern, he will set up so that a bow chaser can be brought to bear. In a stern chase, the captain, could and would manhandle a large gun around to it's maximum allowable arc, to get the biggest gun he could to bear on target.
The normal maximum range of the frigate guns is 2000 yards, without skip shotting, which can extend that range to 2900 yards, the preferred maximum range is 1600 yards, with the closer the better.
The cannons of the age were not inferior and were quite accurate and they only need a few hits, to do serious damage to the sloop, because a sloop at 70 tons is a whole lot lighter than the 2200 ton USS Constitution, then too the limited crew onboard the sloop versus that of the frigate.
Historically the speed of a sloop was anywhere from 10 - 14 knots, which is the same speed as most of the frigates, many larger first and second rates were capable of 9 knots under sail.
Try to call the fall of shot of 4-10 .50 cal bullets beyond 1600 yards, when the trace element is burnt out or almost burnt out, then do the same thing with a 9,12,18,24 pounder cannon, I know what is easier. Also reference the beaten zone in previous post, 55 yards long = 165 feet by 4 yards wide= 12 feet for a burst, this means you are shotgunning at this range with burst fire or even sustained fire, adn this without figuring in the movement of the sloop and other problems associated with long range firing.
The captain of the frigate will also be firing on the uproll, when both the bow is climbing the next wave and rolling slightly, he will do it at the exact same point, from his much stabler platform and the splash of the round shot is much easier to see at range.
A sloop is better armed and a frigate will run from it?
Armament of the sloop of the day (1812), not the later upgunned and better designed sloops of the 1830's and onwards, was up to about 16 guns (depending on source quoted) with the standard being 4 pounder, but 6 pounder's were sometimes encountered, the standard armament of even a light frigate, was 9 pounder bow chasers and 12 pounder longs, the larger ships had 18's, 24's and 32 pounders, not counting carronades and mortars, that sometimes found there way onto ships.
The sloop with a .50 is no more a threat to the frigate, than it was with the 4 or 6 pounder guns, because it has to get close to do any type of significant damage and that plays right into the hands of the Frigate. any attempt to beat upwind of the frigate, play's into the hands of the frigate, with it's greater weight of steel. He just need's to place you within range of his gun's and will alter his course to do that.
The reason that the sloop, ketches, yawls and the like remained viable was they were small, easily handled and fast, while at the same time could handle a fair sized cargo and operate close inshore. The larger ships, disappeared directly due to steam and the wooden sailing warship disappeared, due the introduction of both exploding shell's and steam. Though many navies retained them much longer, because of the cost of replacing them, for unlike a commercial venture, the government derived no income from the construction of new ship's to help defray construction cost's.