Why does my camera start rotating randomly when following a path?
A quick fix can be as follows:

Select your target object edge (Or duplicate it), Hit P "Separate by Selection"
it will create a new object, Select both objects (Your old object and newly created object)

Hit Ctrl + G to add both objects in a group so that they move as a single object
now you may lock the camera view to your new object.

I hope it will help you :)