The problem is that using fix npt and thus changing the box size and having immobile atoms at the same time, is not a good idea. When adjusting the box dimensions you also rescale all atom positions with it by default. That avoids problems at the box boundaries, since otherwise there would either be an unphysical gap between periodic boundaries or immobile atoms may become located outside the box or atoms near the box boundaries - which would be displaced by the longest distance - can be moved on top of immobile atoms, but your immobile atoms are not really immobile. You can change the default behavior by changing the group to which the rescaling is applied via the “dilate” keyword, but you are replacing just one kind of problem with another one.