Loss is part of the process. Just build in for it. When I do 5 gals I'm cutting boil at 6 gals and putting 5.5 gals into the fermenter so that I get 5 gals packaged. If I'm heavily dry hopping I may even increase the volume more than that (or accept I'll package less than 5 gals). One of the justifications for doing 10-15 gals at a time instead of 5 is the percentage loss for samples goes down.
One option to mitigate loss, is using a refractometer instead of hydrometer. Many of us use them for pre-fermentation readings. The problem using them in the fermenter is that alcohol changes the reading so it needs to be adjusted. My understanding used to be that the correction formulas weren't very accurate but if I understand correctly they have improved in recent years.
However, if your goal is just ensuring fermentation is done, you really don't need to correct it, just make sure it's stable, and then you could read with a hydrometer when bottling to get the correct number.
The bigger problem with that method is not tasting the beer- once you get more experience that alone can tell you a lot.
Another option, some people will drop a sanitized hydrometer into the beer itself rather than removing a sample (in a bucket fermenter) but I don't like the oxygen exposure that entails, plus same lack of tasting.
There are electronic doodads out there marketed to homebrewers that'll read gravity real time and report it to a phone and what have you. Basically you'd sanitize em during brew day, pop em in the fermenter, and leave them there.
There's also other alternatives to refractometer or hydrometer, but they get expensive, like density meters that use far smaller samples. Anton Paar (the gold standard for measuring equipment) makes one marketed to homebrewers (and nano-scale pros) but its still $400.
https://www.morebeer.com/products/easydens-anton-paar.html