Diffusion and migration play pivotal roles in microbial communities - shaping, for example, colonization in new environments and the maintenance of spatial structures of biodiversity. While previous research has extensively studied free diffusion, such as range expansion, there remains a gap in understanding the effects of biologically or physically deleterious confined environments. In this study, we examine the interplay between migration and spatial drug heterogeneity within an experimental meta-community of E. faecalis, a Gram-positive opportunistic pathogen. When the community is confined to spatially-extended habitats ('islands') bordered by deleterious conditions, we find that the population level response depends on the trade-off between the growth rate within the island and the rate of transfer into regions with harsher conditions, a phenomenon we explore by modulating antibiotic concentration within the island. In heterogeneous islands, composed of spatially patterned patches that support varying levels of growth, the population's fate depends critically on the specific spatial arrangement of these patches - the same spatially averaged growth rate leads to diverging responses. These results are qualitatively captured by simple simulations, and analytical expressions which we derive using first-order perturbation approximations to reaction-diffusion models with explicit spatial dependence. Among all possible spatial arrangements, our theoretical and experimental findings reveal that the arrangement with the highest growth rates at the center most effectively mitigate population decline, while the center arrangement with the lowest growth rates are least effective. They thus serve as optimal arrangements bounding the mixed phase, where diverging outcomes emerge by tuning spatial arrangements. Extending this approach to more complex experimental communities with varied spatial structures, such as a ring-structured community, further validates the impact of spatial drug arrangement. Our findings suggest new approaches to interpreting diverging clinical outcomes when applying identical drug dose and inform the possible optimization of spatially-explicit dosing strategies.