Commercial real-estate loans could generate losses of $100 billion by the end of next year at over 900 small and midsize U.S. banks if economic woes deepen, according to a Wall Street Journal analysis.