Hi Sandisk,
There are some really interesting aspects to your incident I would like to touch on. First of all, the consensus is probably correct, debris in the tank probably blocked air flow. What's important is how you avoid turning an incident into an accident.
1) Did you have a buddy on the dive? You don't reference getting your buddies attention and getting ready to share air if necessary. By the time you had to switch to your octo, I feel you should made sure to alert another diver to your issue.
I've been in Coz, and I don't travel with a buddy. On small boats there has rarely been another single diver to buddy with. Usually the DM indicates that we will dive as buddies for emergencies. I usually take this to mean that I will dive within comfortable distance of the DM, close enough for me to get to his air in an emergency. In practice, I'm usually farther from the DM than recommended. We're you supposed to be diving with the DM? Did you try to alert him?
2) When you could no longer get air from your octo, you switched to your spare-air. What depth did you switch? What size spare-air? Did it last all the way to the surface? Did you attempt a safety stop? If you were more than 100 feet deep on air, my Nitek duo would have put you into deco after about 16 minutes. I wouldn't want to skip a safety stop from this depth. In fact, you were on the third dive of the day, you could have easily been pretty close to deco at shallower depths.
3) Why didn't you bail out earlier? By the time I needed to get to the octo, I would be getting out of the dive. You might not have been in a position to alert another diver when you went to the octo, But if I were in the caught between trying to get to a distant diver at depth with a failing air supply, or doing a solo ascent with the spare-air, I would immediately ascend, as long as I had no mandatory deco. If you had a deco obligation, you should never had been out of the easy access to another diver and an air-share.
After the safe ascent, checking the tank and regs is important, but assigning blame to the operator for faulty tanks is not a critical issue. Getting to a safe air supply either from another diver or the surface is.
I'm glad this incident had a positive outcome, but you have to be prepared to abort the dive and get assistance. You might have been feeling peer pressure to keep up with the group. Learn to resist it, and when to bail.
Good luck diving