I will attempt to build on from Chocolate's answer, and explain the grammar behind Chocolate's observation:
~~に一人/独り means "I'm (physically) alone/Nobody else is here", while ~~で一人/独り can be used for both "I'm (physically) alone" and "I'm (mentally) alone. I'm isolated.
In [location]に一人です
, the location is an important part of the sentence; dative/locative particle に indicates the target of the verb which in this case is to exist. This means "I am existing alone at [location]" is an unbreakable(for lack of a better word) unit of meaning. This corresponds to being quite literally "physically alone".
For ~~で一人です
, ~~で
is an adjunct. The sentence is still complete without it. This means "I am existing alone" is one unit of meaning. Then the location is an additional incidental information. This means it is possible to first be 一人です
, then the location for where it happens is incidental, including places where there are people. This is why it can be used for both "I'm (physically) alone" and "I'm (mentally) alone.