Commerzbank swung to a net loss in the second quarter amid weak markets and after booking job-related restructuring charges of about 807 million euros.