I can reproduce your result on Firefox Dev Edition 92 and Chrome 92. In my opinion your code is fine and should trigger this error. I’m not sure if it’s a documentation bug or an issue with Firefox and Chrome themselves. Maybe you could ask on the MDN Matrix chat and/or post an issue on the MDN GitHub page. The technical writers are rarely on this forum.