The first case you describe with the bug_test siteaccess is perfectly normal and the same behavior can be observed in a full legacy stack :
An unexpected error has occurred. Please contact the webmaster.
Unable to connect to the database server 'localhost' Error #1045: Access denied for user 'root'@'localhost' (using password: NO) in /Users/lolautruche/workspace/ezsystems/ezpublish/lib/ezdb/classes/ezmysqlidb.php on line 135
This is actually a limitation of the URI siteaccess matching. You cannot have a content with the same name as a siteaccess. If you want to do that, you'll need to use another way of matching the siteaccess (like Host).
This might need a documentation update though (http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Concepts-and-basics/Configuration/Access-methods)
The second case is exactly the same as above, but with a real siteaccess...