I'll need a save file for testing, but I've made some edits that should hopefully fix the issue.
I've added a failsafe tracker for the Buddy Sock usage, applied before and after sleep. If the bubble was not obtained right after waking up, the bubble could now be collected during the mainGameMenu sequence. This should make the item more reliable and should work for both sleep() and sleepHeal() calls.