If a collection agency goes bankrupt how does someone find out who owns the debt?

Even if the collection company goes bankrupt, you still owe the bank whatever money you borrowed from them. The bank hires the collection company to get that money, so you still owe them