But the truth is, making guns in a new caliber and making ammunition to match is easy enough that some hobbyists do it in their garage.
Yup. And a lot of times, those self-packed loads fail. Gunpowder mixture is the wrong type, wasn't packed tight enough, moisture, grease, etc. I've seen these hobbyists you speak of; All of them have at least one story of how they ruined their gun because their custom ammo was shit. You do it amateur, you get amateur results. But hey, don't let me stop you from taking your custom-built guns and ammo into a combat situation...
There are, apparently (I Am Not A Military Expert), valid military reasons to make your guns and ammunition incompatible with the enemy's. America and the rest of NATO were the first to use 5mm-caliber small arms - the M16, FAMAS, L86, etc. are all chambered for a standard 5.56mm round, and I believe most even have compatible magazines.
The "valid military reason" is called "economy of scale". We don't want to blow their budget on ammo, and by happy coincidence, our allies don't either.
Iran is simply doing the same thing. Instead of using NATO-standard 7.62mm miniguns, 20mm autocannons, 40mm grenade launchers or 2.75" rockets, they'll use ones that are just slightly incompatible, but nearly identical in performance.
That would be stupid. Iran doesn't have much of a defense industry; they rely on importing arms. It makes no sense to outfit some of your military with Mark I whatchamagigies and some of them with the incompatible Mark II whatchamagigies. There are few things more damning than sitting next to three full ammo boxes, and not one round that'll fit the only gun you have.
One reason is economics - trying to stimulate their own arms industry,
Whiskey. Tango. Foxtrot. You don't have to reinvent the wheel to stimulate your industry: That's a purely American thing. In the rest of the world, you steal tech, duplicate it, and save yourself the R&D costs. See also: North Korea, China, India, Egypt, Iraq...
Another could be that they are more concerned about being invaded, rather than invading others. You are, after all, more likely to be the one capturing supplies, rather than having your supplies captured, when you are on the attack.
The traditional response to this is to decentralize your weapons depots, caches, and supply lines, and to be as covert as possible. Every ground war we've fought against similarily sized and equipped militaries has been massively asymetrical, and the enemy wears us down by hit and run tactics (which we invented), and urban guerilla warfare. They don't give two shits how much you capture, as long as they've got just enough left to keep costing us economically. They know if we invade, we're out a few more trillion dollars -- and our economy just can't handle that right now (it couldn't before!). Stop thinking like this is conventional warfare: It isn't. It hasn't been since the 70s.
History would seem to bear this view out - during the Cold War, neither side used intercompatible ammunition, and as it turns out, neither side much wanted to invade the other.
History remembers that it doesn't really matter what ammo you use, as long as you've got a fuckton of it. And by ammo, I mean nukes.
The most notable case of cross-compatible weaponry was in WW2, when the British designed the Sten gun to use the same ammunition as the German MP40. And guess what (spoiler alert)? Britain later invaded Germany!
Yeah, why would a country who's factories were burning, a third of its population dead or injured, and entire cities leveled want to put their limited resources towards making sure they could use whatever ammo was available. The mind boggles.
OK, that's probably a massive simplification of things (remember, IANAME), but still, look at things from Iran's view for a second.
I am looking at things from Iran's point of view. I think you should go work for them. The kind of advice you're spouting could set them back an extra decade, easy. Save us a lot of money so we wouldn't have to build IED-resistant personnel carriers, missile defense platforms, and more stealth tech to give us a greater force multiplier.