From what I undestand resident funding comes from CMS. They don't double pay for the same class level for 2 separate residencies. So if you did a 3 yr FP residency, finished, then went into a 5 year surgical residency, my understanding is you would only get paid by CMS for the last 2 years. Some programs have alternate funding that is not CMS based and that may be why the person you know is getting paid.
You're wrong on almost every point. It's really, really complicated how CMS funds residents doing more than one specialty, but the general gist of it is this:
Roughly 2/3 of the pot of money paid per resident is "direct medical education" money, which basically covers the salary +/- some benefits. The other 1/3 is "indirect medical education" money, which pays the hospital to fund everything else.
If you use up all of your funding and continue as a resident in a different program, CMS will still fund the hospital the full amount of DME, and somewhere around half the IME. So rather than the hospital receiving ~$100,000 for you, they'll receive ~$75,000.
How many years of full funding you get is also complicated, but it basically depends on what residency you started with. It's the minimum number of years it would take to complete your initial specialty. So if you matched into General Surgery, you're "assigned" 5 years of full funding. If you then completed 2 years of GS, decided you hated it, and dropped out, you would have 3 full years of funding left. You could then match FM and would be able to complete the entire program without your hospital ever being given less than the full amount of $.
If you did the opposite, and did 2/3 years of a FM residency first, then dropped out and did gen surg, you'd only have 1 full year of funding remaining for your gen surg program, and all of the remaining years would still be funded by CMS, but at a decreased price.
This all leads to some interesting stuff. For example, as the minimum number of years to do EM is 3, all 4 year EM programs basically fund that year themselves, as CMS doesn't see why they would need to pay for it themselves. Ditto for programs in other specialties with things like research years.
Why is the system so ass-backwards and make no sense? I have no idea. Ask the government.
As for anyone doing a residency for free, that's 100% impossible. At least for any ACGME-accredited program, they're required to pay all their residents the same. You can't do it for free, and programs can't add spots willy nilly without the ACGME's approval.
(Edit to add this note: This is all to the best of my understanding. Someone like APD would know much more about this than I would, but I think the above is generally accurate.)