For years my approach to a misbehaving I2C device was to stare at the datasheet, reflash the firmware, add a print statement, and repeat until either it worked or I gave up and blamed the breadboard. That is debugging by séance. It mostly fails.
So I finally bought one of those eight-channel clone logic analysers, the little blue ones that cost less than a round of drinks and pretend to be a Saleae. With sigrok and PulseView driving it, you clip the probes onto SDA, SCL and ground, hit capture, and there is the bus. Actually there, decoded, addresses and ACK bits and all.
The sensor I was fighting turned out to be answering on a different address than I'd assumed, because I'd misread which way the ADDR pin was strapped. No NAK, no error, just the controller talking to nobody and reading back 0xFF forever. Thirty seconds of looking at the decode and it was obvious. Thirty minutes of staring at code had told me nothing.
The lesson isn't subtle. If you work with serial buses at all, owning the cheapest possible logic analyser is one of the best value purchases on the bench. It replaces a category of "it should work" guessing with simply looking at what the wires are doing.