Issue with Inbound Account and Folder ID in Emails Page

I cleared the cache, but that didn’t help. I found that in the StoreQuery class, loadQuery saves the wrong folder ID. In the populateRequest() method, $_REQUEST has the correct folder ID, but it gets overwritten by the data returned from loadQuery. However, I couldn’t find where the data for StoreQuery::getStoredQueryForUser($name) comes from.
Additionally, I’m not sure why this issue is occurring now and not from the first time I used it.
I’ve added conditions to prevent overwriting the folder ID, but I think this is not a thorough solution.