  Motivated by the quasi-local mass problem in general relativity, we apply the
asymptotically flat extensions, constructed by Shi and Tam in the proof of the
positivity of the Brown--York mass, to study a fill-in problem of realizing
geometric data on a 2-sphere as the boundary of a compact 3-manifold of
nonnegative scalar curvature. We characterize the relationship between two
borderline cases: one in which the Shi--Tam extension has zero total mass, and
another in which fill-ins of nonnegative scalar curvature fail to exist.
Additionally, we prove a type of positive mass theorem in the latter case.
