Looting is kinda broken – If you can't find any material in let's say, the first three lockers you open in a settlement, then the whole place is probably bugged and the only item you'll be able to loot from the entire settlement is the power regulator from the PWR building.
From my experience, relogging will not fix the problem, but rather cause it: I decided to relog a first time from inside a settlement after glitching through the floor, and a second time because I accidentally accessed my SRV's turret cam, which… Caused the entire settlement to turn hostile in a few seconds.
And while before the first relog I was still able to find loot in buildings and inside lockers, it had all disappeared, including from the places I hadn't looted before.
Changing game modes does not seem to fix the problem either. But changing systems and coming back does reset the settlement to 100%, it seems.
TLDR If you can't find any loot within the first few lockers, the settlement is bugged. Switch systems and come back. It will reset the settlement to 100%, loot spawns included.
On a side note, you can't deploy SRVs while you're landed on a settlement landing pad, and the galaxy map travel history only seems to work half the time. Go figure.