Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
I truly wish you haven't been wasting as much time as I have this week with SharePoint anonymous access and a custom master page.
I have a site that uses a custom membership provider, forms authentication, anonymous access and a custom master page. My problems were many but in the end the main one was getting anonymous access to the home page. This would always give me an ugly 401 error.
After a good nights sleep and with a clear head, I finally realised that the problem was not with Pages/default.aspx but with it's masterpage which as not deployed correctly. I had missed putting type="GhostableInLibrary" into the file node of the module:
<
It's the little things that can really screw you!
TGIF.