The problem is that your using the next traversing function rather than nextAll
$("button[disabled]").nextAll(".error").text("this button is disabled");
When you use next its just looking at the “next” element which is
<span>no overwrite</span>
Next all looks at all siblings that are next