The real question is thus:
Considering he should better daven at home with a hat rather than at a minyan without a hat, does that mean if he won’t have a hat either way (he’s away from home and forgot his hat) he should daven at home (without a hat/jacket) or should he daven with a minyan (without a hat/jacket)?
Essentially, the question is whether the problem is davening without a hat/jacket (bchlal) or the problem is davening in a shul (with a tzibur) without a hat/jacket.