It's possible LS dropping the connection, because your Beat have been inactive for too long.
Have you tried setting client_activity_timeout
to a bigger value in LS?
https://www.elastic.co/guide/en/logstash/current/plugins-inputs-beats.html#plugins-inputs-beats-client_inactivity_timeout