Looking at your examples I’d try (on a copy of your line at in a new layer, lock or hide your other layers so they’re not affected)
- select all (ctrl+a)
- object/path/outline stroke
- draw a rectangle/shape larger than your artwork and entirely covering it (make it a solid color to help see what’s happening)
- select all again
- switch to Shape Builder tool (shift+m)
- holding down alt key hover just inside edge of rectangle (should change appearance and your cursor should have little minus sign next to it) single click will remove the outside part of overlapping rectangle leaving just a shape the exact shape of your line art
At this point all your line art is still under the new shape.
Lock the new shape (select it and ctrl+2) and delete all the bits underneath or delete them all from the layers palette.