Yes- Flatten is usually meant for entities that you'd usually think of as 2D- lines, arcs, circles, etc. It changes the Z value to zero. That's your best bet.
Another thing I'll do if I'm only dealing with say one end of only afew lines, for instance, is with no command running, select the line and pick its grips and use XY point filters- you'd pick the grip, then when asked for the destination (for that grip) go to OSNAP-Point Filters, choose "XY", pick the grip again, and when asked for "Need Z" type in "0". It'll drop that end to the current UCS. If the other end is off the UCS too, do the same thing to it. Both will be on the UCS, Z will = zero for the entire line, and you can move to anither entity.
But if you have too many entities to do this way, use the flatten.lsp, and then use this method to clean up any stragglers. The original problem might have come from not being careful about that Z coordinate when selecting an osnap, or something similar.
Also- avoid solprof, and begin to use soldraw instead. Some of the problem should diminish.
Good luck !
C. Fee