When troubleshooting the first step is to
islolate the problem then fix it.
Helping from afar my instinct is to take a fresh look at what you worked on last for the problem, IE the iggy switch. Very simple to make a jumper to eliminate the iggy switch and see if that's where the issue is, that applies broadly to everything electrical. Hot wire directly from battery to pamco/coil red wire does it run, rev now?
An example perhaps or mebby just story telling?
Yesterday started troubleshooting a new to me bike. PO had installed a new harness and never got it to run again. Methodical always wins; removed battery, topped up with distilled water, charged, checked it holds a charge, reinstalled, checked ground, power wires, connections. Turn on iggy, nothing, found blown fuse, replaced, ignition switch on, fuse glows, blows. Installed a circuit breaker in place of fuse for troubleshooting.
Turn everything off,
then iggy on, lights etc worked, found breaker would trip as soon as I turned the kill switch on. OK issue is in ignition circuit. Removed the gas tank and found this.
Know now I will be able to trust NOTHING on this bike was done right.
With a custom DIY electric setup like yours, extensive troubleshooting, checking EVERYTHING is likely the only way forward to a bike you can trust.
Unresolved electrical issues are
likely why the PO sold it.
I doubt having a shop work on it will be economically feasible. It will have to be a small independent, a dealer, large shop will run screaming when they see all the custom stuff. Unless the PO supplied you with a wiring diagram of what was done (what are the odds?) MUCH time ($$$$) will be sent head scratching, deciphering the control logic. This is never trivial on any bike, on a custom with no diagram or standard wire colors, it may involve basically rewiring the bike, been there done that, several times.
Has it
ever run well at higher RPM for you?
Still trying to decide what the function of that "junction block" is "junction block" is normally the "fuse box" in a simple bike like the XS.