Rewrite of Custom Post Type doesn’t work with dynamic data

Well… I didn’t know that the expressions in the rewrite attribute of CPT must be registered in advance:

add_rewrite_tag('%baz%', '([^&/]+)');