When the cube rotates, the line does not rotate with the cube. It is always pointing in the global Z axis.
A long time ago I used LookAt function and debug.DrawLine and it was working without implementing any other code for rotating the line with the cube. I have no idea why its not working now =(
Vector3.forward is a static vector (0,0,1). You have to use MySillyCubeTransform.TransformDirection(Vector3.forward) to make it a direction relative to the cube.