If you just want to group lines that are between points of the PE#### point layer and there's no branching, use this approach:
- Dissolve the line layer with the Dissolve tool. Use the Keep disjoint features separate option (available since version 3.26)
- If your version is lower than 3.26 and there was no Keep disjoint features separate option then run the Multipart to singleparts tool on the Dissolved layer, else skip this step.
- Open the Geometry by expression tool.
- Set as Input layer the Dissolved layer (if you did step 2 it'll be called Single parts)
- Set the Output geometry type parameter to Line
- Click the button of the Geometry expression parameter, then go to the Function editor tab and add a file with the button. Now in this new file paste this code, and click the Save and Load Functions button:
@qgsfunction(args=-1, group='Arrays', referenced_columns=)
def array_zip(arrays, feature, parent):
return list(map(list, zip(*arrays)))
this code defines one function that will be used by the following expression.
Return to the Expression tab and paste the following expression, remember to change 'Point layer name/id' with your values, click ok and run:
layer:='Point layer name/id', -- replace here with your values
array_slice(@section, 0, -2),
array_slice(@section, 1, -1)
Finally, but it looks that the lines are still merged, this happens because it's a multiline geometry. So run the Multipart to singleparts algorithm in this layer (Modified geometries) and you'll be done.