The rule of the DH is whomever replaces the DH becomes the DH, which is locked in the batting order.
Fun fact, if you pinch hit for a position player, and come up agin in the same inning, that is not a pinch hitting appearance. Instead, you bat as a “nothing”. The one position that doesn’t hold true is the pinch hitter for the DH. If that spot comes up again in the same inning, you bat as the new DH the second time.
Anytime someone bats for the DH, they must be credited with a pinch hitting appearance first.