Check your custom functions and exposure modes.
Depending on the mode, various flash shutter speed options are set within a range according to the ambient light. But you can change it in custom functions. In Av for example, the standard default is to track the shutter speed according to ambient without any limit but if you disable this it will set the max x-sync speed instead - 1/200sec on the 5D I think, and 1/250sec on your 40D.
In P, the camera will again track the shutter speed against ambient, but only down to 1/60sec I think (to avoid shake and subject blur).