Was your craft out of line of sight because it was too far to see, or because it was obscured from view by a tree or treeline?
OEM flight specs are for clear day, no RF interference in the form of trees, buildings, EMF noise, competing RF traffic (home wireless routers use 2.4 and 5.8GHz frequencies), with proper antenna orientation. Do you know where your antenna null zone is?
Trees between you and the bird will be a problem every time. 100% reproducible issue.
A bit more research on basic flight requirements will help you. We're all excited to get our new birds in the air, but more time spent on understanding flight control and FPV dynamics, how and why they work the way they do, will serve you best.
DJI puts the manuals on line for your bird. Find the manual, read it carefully, and you will be a happier and more satisfied pilot when you understand how the pieces all work together.
Good flights.