The essence of remaining within the no deco limits is that a direct ascent to the surface is possible at any time, so long as you don't exceed the ascent rate programmed into the tables. For the PADI RDP, that ascent rate is 60 fpm. So long as you took a full minute to reach the surface, and exhaled the whole way, the likelihood is that you would have been fine.
I think you learned your lesson about checking your gas -- but there are a couple more lessons here, too. You went to the DM for gas, which implies to me that you either did not have a buddy, did not know where your buddy was, or could not reach him. You just learned why buddy teams need to stay close to one another, even when the viz is good. If your spare gas is on somebody else's back, you need to keep that back where you can reach it!
Second, if I am reading your story correctly, the DM to whom you went for gas ran out on ascent as well. What does that mean? It means that he did not retain enough reserve gas to get two people to the surface from where you were. How much gas it that? There are actually ways to calculate it (
HERE is a good article on that), and a prudent diver never empties his tank more than that, because you never know when you might have to help someone else. You are not at fault for not knowing about this, because it is not taught in the recreational curriculum of many agencies. But now you know -- plan your dive; you should know what the maximum depth expected is, and you set aside enough gas to get you and your buddy to the surface from there.
Glad you were okay, and thank you for sharing your experience so that other people can learn from it. It takes a rhino hide to admit error here, sometimes.