You could do an old-school buffer-debuffer technique (discussed many time on this site e.g. here and elsewhere too) followed by hole removal. The key here will be the amount you buffer-debuffer by. By looking at the second image I'd go for about 2 or 3 times the raster resolution.
Alternatively you could try using a concave hull tool (aka alpha shape). This is like a convex hull but a lot tighter. To find this simply type 'concave' into the Processing Toolbox search and it'll pop up in Qgis 3.x (earlier version need a plugin to be installed). It's under Processing Tools->QGIS Vector Geometries and you'll find a couple of options to try. It'll all depend on your tolerances etc.