Came to this through trying to use Celerity against a Merb app. The stack trace that was puzzling me was this:
com.gargoylesoftware.htmlunit.ScriptException: Error: Could not load 'dijit.form.FilteringSelect'; last tried '../dijit/form/FilteringSelect.js' (http://localhost:4001/javascripts/dojo/dojo.js.uncompressed.js#854) (NativeException)
com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine.java:534:in `run'
The app works fine in Firefox, but many JavaScript files fail with 403 errors. Turns out Merb doesn't allow ".." in URLs that access files, presumably as a security feature. So even when in Firefox emulation, HtmlUnit is doing something different - it's not compressing URLs like "http://localhost:4001/javascripts/dojo/../dijit/form/FilteringSelect.js" into "http://localhost:4001/javascripts/dijit/form/FilteringSelect.js" before sending the request. Now, there's arguably no reason it should, but it does mean it behaves differently from Firefox.
Should now be fixed in SVN. Thanks for reporting.