The gallbladder excretes cytotoxic bile acids into the duodenum through the cystic duct and common bile duct system. Sox17 haploinsufficiency causes biliary atresia-like phenotypes and hepatitis in late organogenesis mouse embryos, but the molecular and cellular mechanisms underlying this remain unclear. In this study, transcriptomic analyses revealed the early onset of cholecystitis in Sox17 +/− embryos, together with the appearance of ectopic cystic duct-like epithelia in their gallbladders. The embryonic hepatitis showed positive correlations with the severity of cholecystitis in individual Sox17+/− embryos. Embryonic hepatitis could be induced by conditional deletion of Sox17 in the primordial gallbladder epithelia but not in fetal liver hepatoblasts. The Sox17 +/− gallbladder also showed a drastic reduction in sonic hedgehog expression, leading to aberrant smooth muscle formation and defective contraction of the fetal gallbladder. The defective gallbladder contraction positively correlated with the severity of embryonic hepatitis in Sox17 +/− embryos, suggesting a potential contribution of embryonic cholecystitis and fetal gallbladder contraction in the early pathogenesis of congenital biliary atresia.