Cats get well after eating for 7 days. You can look at his stats and it will tell you how many days he has left before he isn't sick anymore. However, if you gave him Get Well vitamin, he should have recovered instantly. This is Get Well:
https://kittycats.ws/manual/article.php?id=34&oid=20
Are you sure that's what you gave him? There is another vitamin that some times people mix up, called Pet Food Recovery, which is what you give a cat who has had their breeding turned off and you want them to start gaining love again. It is this one:
https://kittycats.ws/manual/article.php?id=35&oid=20 Did you maybe give him that one by accident?
As far as the food going bad: there have been a few upgrades to the food system over the years. If you have really old food that you purchased, kittycats has a way to convert it to new food (but it's manual, you have to message a CSR and they do it in person). However, it doesn't work with really old freebie food.