Deutsche Bank’s plans to retreat from risky investment banking, fire thousands of people and return to its German roots may eventually create a healthier lender. In the short term, the overhaul will be a major financial drain.

That was made clear on Wednesday, after the bank reported a loss of 3.2 billion euros, or $3.6 billion, from April through June, as it subtracted the costs of a restructuring plan announced earlier this month. The plan is seen as a last-ditch attempt to arrest a decade of decline.

The loss, which was more than the bank had flagged earlier in July, underscores the challenges facing Christian Sewing, the bank’s chief executive, as he tries to regain the confidence of customers, investors and regulators.

Deutsche Bank said earlier this month that the quarterly loss would be €2.8 billion. The bank’s shares fell almost 6 percent in Wednesday morning trading as investors registered their disappointment, though the stock later recovered some of the losses.