https://imgur.com/a/neddGf5 As you can see I haven't placed the chest but have dug up a few holes, additionally the placement indicator(the square border thing doesn't show). Pressing X digs more holes(although I have the chest selected).
To get out of this state I spam Z + X until the placement UI shows up -> https://imgur.com/a/ILEC2bI now on the next X the chest gets correctly placed.
I need to do a similar trick every time I want to switch to a seed/hoe/water. Hopefully, this helps.