dnd 5e – If you are in the Astral Plane, can you put a Keep Bag inside another to leave the Astral Plane?

No: the portal takes things. todo not since, the astral plane

The rules for placing bags to hold each other establish the following (DMB page 154, bold added)

Place a bag of objects inside an extradimensional space created by a Heward handbag, a portable hole or similar element [e.g. another bag of holding] It instantly destroys both objects and opens a door to the astral plane. The door originates where the element was placed inside the other. Any creature 10 feet from the door is sucked through it to a random location on the astral plane. The door then closes. The door is one way. and it can not be reopened.

The rules do not say that it opens a portal "between the material plane and the astral plane", or a similar wording. The portal opens only to the astral plane, independently of the airplane in which it is when placing the bags between them.

The fact that the portal is only one way is also crucial. Even if you were in the Astral Plane and someone in your plane of origin tried to put two Bags of Keeping one inside the other (still in your plane of origin) with the hope of opening a portal through which you could travel to return home, not they would succeed. The portal only carries things. to The astral plane: does not provide travel. since that.

If you had to place two Bags of Keeping one inside the other while you were in the Astral Plane, the portal that was opened then would deposit you in "a random location in the Astral Plane". At the most, you would move to a different part of the Astral Plane: you would not have the opportunity to escape from it.