Phantasmal Force may be the closest thing to achieving your desired results, if you find that using Wish seems like a cop out.
First, the easy spell: Wish. Technically, you can make this spell do anything you want it to do subject to DM approval. It's the ultimate get out of jail free spell.
PHB pg. 288; Wish
For a more mechanical flavour geared towards what you're asking:
PHB pg. 264; Phantasmal Force (only the pertinent parts quoted below, emphasis mine):
The phantasm includes sound, temperature, and other
stimuli, also evident only to the creature.
While a target is affected by the spell, the target treats
the phantasm as if it were real.
Basically, this would allow you to make an object effectively immobile or unmovable to a single target, for up to 1 minute (pending the target fails the saving throws).
Alternately, you could also have something undergoing a persistent Phantasmal Force cast at a higher level that has a permanent effect if it's part of a magical item effect, or through the use of a Wish spell. However this would be something the DM would have to approve.