If encountering this error, Shown here:

It is usually caused by walls being created by DEPTH rather than HEIGHT. To correct the issue, follow the direction below:

In the options bar (on top below ribbon when you start Wall command) there is an option for "Height/Depth". If it is set to "Depth", Revit will expect a wall to be drawn from TOP to BOTTOM, and setting a "Top Constraint" in this case will actually be referring to the bottom constraint of the wall. It's somewhat similar to Structural elements in the sense how they work upside down

Change this setting to Height, and that should correct the issue