Thank you, Christian, now I understand!
Incidentally, nevertheless I am not sure the following behaviour is correct:
basex "<_ xmlns='bar'>{element foo {namespace {''} {'bar'}}}</_>/*"
=>
[XQDY0102] Duplicate namespace declaration: ''.
As the dynamic constructor is located in a static context with a default namespace, the foo should be interpreted as a name in that namespace, thus "if the name of an element in an element constructor is in no namespace" does not apply.
Cordial greetings,
Hans-Jürgen
PS: By contrast, this works:
basex "<_ xmlns='bar'>{<foo/>}</_>/*"
=>
<foo xmlns="bar"/>
PPS: And this also works:
basex "<_ xmlns:f='bar'>{element f:foo {namespace {'f'} {'bar'}}}</_>/*"
=>
<f:foo xmlns:f="bar"/>