Maybe the Scores updating function that runs every 5 minutes is a concurrent thread, and it sets all countries to Rank 0 before looping over all countries, sorting their new rank, and writing to each country's db.
Accessing the country during the scores update would probably retrieve it as Rank 0 then.
Yea, I truncate the ranks table before writing to them. So attempting to access it during that time could result in a Rank 0; Though some things, like the ranks feed, will wait for the update, via a GET LOCK in sql ;)