You clarify in a comment:
Well, you isolate the position of the particle, which leads to an increase of its momentum. However, the particle's collision on the box will reduce its kinetic energy, thus violating the uncertainty principle, or conservation of energy.
All laws in physics hold for isolated systems. There is no energy conservation or momentum conservation in systems that are not isolated.
In your description, inelastic, energy and momentum get out of the box so the particle is not isolated within the box. In a real experiment the energy and momentum will leave both from contact with the walls and by radiation due to stray fields on the walls, as black body radiation type. Thus you can apply the $dp.dx$ Heisenberg uncertainty principle only within a $Δ(t)$, as $p$ is continuously diminishing. The most this hypothetical box could squeeze in space would be in the dimensions of the molecules constituting the sides of the box, the final uncertainty in the momentum, and the final inelastic collision: it will then be a part of the molecules of the wall, with the appropriate momentum and position definition.