They had “machine guns” in the Civil War. They weren’t true machine guns (hence the quotes) but they did have hand cranked weapons like the Gatling Gun that you mentioned, as well as a handful of lesser known weapons like the Agar Gun, and a few other oddballs that weren’t hand cranked.
There were two major issues, though.
The first issue is that brass was difficult to make, and making enough cartridges to feed a machine gun was extremely difficult and extremely expensive. Cartridge weapons really took off after the Civil War due to advances in brass production that occurred in the 1870s. Without the ability to produce cheap brass cartridges, machine guns were too expensive to operate. There were a few weapons with a high rate of fire that were shown to Abraham Lincoln, and while the President was very impressed with them, the Army turned them down and refused to adopt them because they knew it would be too much of a logistical strain to field any of them.
The second issue, which is somewhat related to the first, is that they didn’t know how to use machine guns. Because ammunition was so expensive, they didn’t use them on the battlefield. Instead, they used them to guard choke points like bridges and passes, where their high rate of fire could be maximized against the enemy. As such, the few “machine gun” type weapons that were fielded saw very little real use during the Civil War and overall didn’t have much of an effect on the battlefield.
When they finally stared using the Maxim Gun on the battlefield, it changed the nature of war dramatically, ushering in the era of trench warfare.
It’s not enough to teach them how to make a machine gun. You have to teach your Civil War era ammunition producers how to make cheap brass if you want the weapon to be practical. Otherwise your machine gun is just an extremely expensive weapon that they can’t afford to field in any significant numbers.
And if you do somehow teach them to make cheap brass, you also have to convince them that the weapon is actually a game changer on the battlefield and shouldn’t just be used defensively at choke points.
This was a big issue, even during the Civil War. During the 1840s and 1850s they had been continually advancing the ability to manufacture interchangeable parts. But while most Civil War muskets were produced with parts that were supposedly interchangeable, if you look at actual surviving weapons from that era they were still doing a lot of hand fitting and fiddling to get all of the parts to work. So even through parts were supposed to be interchangeable, they often weren’t.
In the 1400s they were still using matchlocks. The flintlock hadn’t even been invented yet. Wild West era rifles would seem like magic to them.