It doesn’t make sense for a simulation to not proceed unless there was an error. But also, this kind of thing (adjusting periodic box boundaries) has been discussed very frequently on this forum, for example: Simulating bulk fluid between two walls - #2 by akohlmey
Briefly, whenever a configuration is compatible with a set of periodic boundary conditions, the simulation will proceed identically no matter which initial periodic image any of the particles are initially in (up to numerical drift). Whenever a configuration is not compatible with a set of periodic boundary conditions it will either exhibit dramatic non-equilibrium shocks (if it is atomic) or fail completely (if it is molecular and there are bonds across incompatible boundaries).
Please consult a standard molecular dynamics textbook (such as Allen and Tildesley) in which this will be explained in far more detail and clarity than any poor forum volunteer can do.