I find it strange that the sequence is fetched after the parent table row was inserted.
Why is it strange ? How else can the code tell which ID to use in the JOIN-ed table INSERT statement ?