Yeah, it's exactly like that, except in cases like Madoff, the banks take a big share of the stolen money. That's why there is always the suspicion that they weren't just innocent bystanders.
How many banks were involved? There were a lot of people banking money too. So how did the banks know that the money came from a ponzi scheme? Did Madoff tell them it was fraudulent money?