@Lauralollipop01 The only time it's done that to me is when I've used platform arrows instead of foundation arrows and the stairs seemed to think I wanted them to come up from the ground instead of placing on floor. I don't think it's really anything to do with the wall beside them as such.
One workaround that I resort to rather frequently when stairs are being obdurate is simply going out to manage worlds and then coming back and doing them over.
Other thing is to make sure move objects is on so that windows/doors/overhead lights don't interfere with stair placement.
One more thing I've found is that stairs with treads but no risers or enclosure beneath are sometimes easier to place. You can always replace them with stairs you like better once they are in place. Again, if you get the "op generation failed", just go out to manage worlds and come back.