I don't think it is necessarily a bug, it's a "core" feature of similar games of this type: https://en.wikipedia.org/wiki/Sokoban I don't think you were necessarily going for a puzzle game, but the mechanics are very similar to Sokoban.
Basically, the idea is that if you push an object against an edge 3 blocks wide you can no longer move it back. The main goal of such games is to avoid situations like this. Most of those games have a quick restart option.