  We investigate the dynamic Casimir effect (DCE) of a $1+1$ dimensional free
massless scalar field in a finite or semi-infinite cavity for which the
boundary condition (BC) instantaneously changes from the Neumann to Dirichlet
BC or reversely. While this setup is motivated by the gravitational phenomena
such as the formation of strong naked singularities or wormholes, and the
topology change of spacetimes or strings in quantum gravity, the analysis is
quite general. For the Neumann-to-Dirichlet cases, we find two components of
diverging flux emanate from the point where the BC changes. We carefully
compare this result with that of Ishibashi and Hosoya (2002) obtained in the
context of a quantum version of cosmic censorship hypothesis, and show that one
of the diverging components was overlooked by them and is actually
non-renormalizable, suggesting to bring non-negligible backreaction or
semiclassical instability. On the other hand, for the Dirichlet-to-Neumann
cases, we reveal for the first time that only one component of diverging flux
emanates, which is the same kind as that overlooked in the Neumann-to-Dirichlet
cases. This result suggests not only the robustness of the appearance of
diverging flux in instantaneous limits of DCE but also that the type of
divergence sensitively depends on the combination of initial and final BCs.
