Misfolding of a bacterial autotransporter