Error “The given object ID is not that of a menu item” on menu with 40+ items

The solution I found was to get in touch with my webhost and have them up the PHP memory limit on my account from 64MB to 128MB. The problem went away after that.