In a old site, I was changing the way that CustomErrors works by adding redirectMode=\"ResponseRewrite\" (new in 3.5 SP1):
I know this question is a bit old, but I thought I should point out that it doesn't need to be a static file to get this working.
I ran into a similar thing, and it's just a matter of finding that error in your Error.aspx, in our case it was because the masterpage in use relied on a piece of session data and when ResponseRewrite was set the session is not available to our Error.aspx page.
I haven't worked out yet whether this unavailability of session is due to our specific app config or a "by design" part of ASP.net.