  Density functional calculations are carried out to study the symmetry and
substitution-driven electronic phase transition in BaPb$_{1-x}$Sn$_x$O$_3$. Two
end members BaSnO$_3$ and BaPbO$_3$, are found to be insulating and metallic,
respectively. In the latter case, the metallicity arises with the presence of
an electron pocket, formed by Pb-s dominated conduction band edge, and a hole
pocket formed O-p dominated valence bands. While electron carriers are found to
be highly mobile, the hole carriers are localized. Our study reveals that an
insulating phase can be realized in the metallic cubic BaPbO$_3$ in three ways
in order to explore optoelectronic properties. Firstly, by lowering the
symmetry of the lattice to monoclinic through rotation and tilting of the
PbO$_6$ octahedra. Secondly, by hydrostatic pressure, and thirdly by alloying
with Sn substitution. The presence of soft phonon modes implies the
plausibility of symmetry lowering structural transitions. Furthermore, unlike
the earlier reports, we find that Sn substituted BaPbO$_3$ cannot exhibits
topological insulator phase due to absence of the band inversion.
