Historically, marine populations were considered to be interconnected across large geographic regions due to the lack of apparent physical barriers to dispersal, coupled with a potentially widely dispersive pelagic larval stage. Recent studies, however, are providing increasing evidence of small-scale genetic segregation of populations across habitats and depths, separated in some cases by only a few dozen meters. Here, we performed a series of ex-situ and in-situ experiments using coral larvae of three brooding species from contrasting shallow- and deep-water reef habitats, and show that their settlement success, habitat choices, and subsequent survival are substantially influenced by parental effects in a habitat-dependent manner. Generally, larvae originating from deep-water corals, which experience less variable conditions, expressed more specific responses than shallow-water larvae, with a higher settlement success in simulated parental-habitat conditions. Survival of juvenile corals experimentally translocated to the sea was significantly lower when not at parental depths. We conclude that local adaptations and parental effects alongside larval selectivity and phenotype-environment mismatches combine to create invisible semipermeable barriers to coral dispersal and connectivity, leading to habitat-dependent population segregation.