に借金があった

owed … money

→ に
phrase Rare #30,329
owed … money に marks the person or organization that was owed the money. 借金があった means there was a debt; in natural English, this is usually expressed as “owed … money.”
JA: 彼は私に借金があった。
EN: He owed me money.

ラナーは私に借金があった

Rana owed me money.

— ダーク・プレイス (2015)

「生きていたときは、君に借金があった」とブルネルが訂正した。

“I owed you money when I was alive,” Brunel corrected.

彼はバチュチュに借金があった

He owed Bachuchu money.

— Article 15 (2019)

彼は私に借金があったんです

He owed me money.

— Article 15 (2019)