It doesn't work because the return type is a Wrapper<t>, not a WrapperForFloat.
Essentially, you're doing this:
WrapperForFloat wff = new Wrapper<float>(x);
That isn't going to work. The compiler won't do an implicit downcast from Wrapper<float> to WrapperForFloat for you.
It doesn't work because the Wrapper class may not implement all of the methods exposed by the WrapperForFloat class, so you can't treat the resulting cast object as a real WrapperForFloat instance.
There isn't any nice way around this. See this discussion
] and some possible work arounds.