Child records (line items) get linked to the parent form AFTER the child form is saved.
💡Tip
The linked field of the parent doesn't need to be included in the child's form. We recommend that you remove it to avoid confusion. The child records get linked automatically to their parent after the form is submitted.
If for some reason you need to create the parent record and child records at the same time, you can achieve something close by enabling Save & Continue feature (previously referred to as Compute Mode)
You can also hide the linked records field conditionally to force the user to click Save & Continue first in order to see the field.