Fix #13810: .replaceWith(nextSibling)
(cherry picked from commit d8f7e8371230a6dd504ca02e65442745b6ff6ce2)