From what I have seen so far, I think the PWM is primary meant to run short periods. The spec says
Pulse lengths and waveform periods can be modulated from a few microseconds to several milliseconds
And the PWM driver as of now is configured to use a 1us unit.
As the period register is 16 bits, this will allow to define period up to 65535us = around 65ms.
When you set the period to 10000ms (eg 10000000us), it will be actually masked to only the 16 valid bits which gives you 38528 us. That probably explains the 40ms you're reading.
So my conclusion is that for now, you should limit to 65ms maximum period. Maybe this could be improved somehow but at least this explains your observations.
Also I don't see a way to return an error to the caller of the pwmout API ... maybe this can be improved as well?