‘dyn Foo’ is its own type, distinct from any particular type that implements Foo. In your working version, the compiler can infer that the box needs to contain a dyn Foo object and constructs it automatically.
In the first version, the compiler doesn’t know the type you need and so does the straightforward thing of just making a plain Bar. If you specify the actual type you need, it also works correctly: