I've also had this fun problem for a while, so I thought I'd add my two cents. After reading this thread through and trying various suggestions I've come to the conclution that in my case the fun popup 404-windows gets going if I try to add a new calendar in iCal. If I then uncheck and recheck the calendar option under my Gmail account settings the popup stops but my newly added calendar is gone.
If I instead create a new calendar in my Google accout in the browser, then it also pops up in iCal and no 404s. So I would guess that Google is not letting iCal create new Calendars thus returning the 404 message.
I just did this and it worked.
From the side bar, right click on your gmail or what whatever email the 404 error is talking about.
> Get info
> Account Info, new window should pop up
> Click gmail from sidebar again
> Click edit account, another window should pop up
> Click on your email thats having the error and it should prompt to retype your email and password
> Enter them and press ok and just close everything.
SHOULD WORK Goodluck
Disclaimer: I read very few previous replies so someone else may have already written this or disproven it. Apologies in that case.
My really lazy solution which worked was to
a. close iCal
b. navigate to Internet Accounts in Control Panel
c. remove the account having issues
d. create a new internet account; it will ask you for three values....
NAME: I used a different name than before (you can pick any name)
EMAIL ADDRESS: I used the same email address EXCEPT with an added dot in the middle. For example if my email was email@example.com I would enter it as firstname.lastname@example.org in the email address field. The dot doesn't matter for this setup; Google ignores the dot always. (You can verify my statement by sending yourself an email with a dot in the middle of your google username; it works.)
PASSWORD: For me, I need to use 'App password' so I generated a new one at this point.
f. tick the box to enable calendar sync
g. Run iCal and verify
My theory (totally unproven) is that OSX is storing an old App Password somewhere and trying to connect to Google with that password, which I've already revoked. By putting a dot in the middle of the email address and registering it as a new Internet Account in OSX, I trick OSX into using the supplied password instead of trying to use the old, revoked password. It seems to work because now iCal is connecting to google without giving me any password pop-ups, etc.