Banks with commercial real estate exposure have struggled after the Federal Reserve hiked interest rates through 2023, leaving them with unrealized losses.