Debug Draw ray bouncing around

I’m trying to make a cube move in a direction when a raycast registers a hit with a wall. It seems to work. But the raycast in the scene view is falling off the cube then bouncing back. And it continues to fall further away while bouncing back and forth. It happens even when the raycast doesn’t register a hit.

Any help would be much appreciated. Thank you.

[edit; nm, completely mis-read the question]

Okay I fixed it… Apparently having a character controller and a rigidbody on the same object causes bad stuff to happen.