Are those folders full by chance? I think there's a limit of 20 apps per folder. Otherwise, you're jiggling them, moving to the dock and moving them where you want to right? I have had some get hinky about adding to a folder while it's in the dock. Moving it out usually does the trick.