I'm making some logic leaps here, but what I think you need to look at is Collision Layers. Putting the things you want into layers so they will collide only with what they're supposed to.
Once you get things into layers, you won't need to fiddle with getting "the first" collision, it will only collide with what it should collide with.
Watch this excellent video on Collision Layers, makes it very easy.
Godot 3 - How to Use Collision Layers