Automation loses focus and stops recording

I’ve had similar issues. I’m not in front of my setup now but if I remember right I had to turn off ‘Track selection follows edit selection’ or similarly named setting to while recording to not loose the connection.