This bug happened initially with 1.12, and was quickly hotfixed within a day or two. Now with 1.14, it's back EXACTLY as it was before.
cursorTarget cannot read properly inside buildings. You'll get the building targeted if there is, for example, a crate inside of it. There are other issues that come from this bug, too.