Could be a pulled muscle or turned ankle, might be a sign of B vitamin - especially niacin - deficiency. Some ducklings just seem to need more.
I would take a close, gentle look. Sometimes there is a splinter, or a long human hair wrapped around the upper part of the leg.....
For niacin...