Your code can be simplified to the following:
using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main()
{
Dictionary<string,int> players = new Dictionary<string,int>();
players.Add("Bill",0);
players.Add("Tommy",0);
players.Add("Daisy",0);
string previous = "";
for (int n = 0; n < 6; n++)
{
Console.Write("Player Name : ");
string player = Console.ReadLine();
if (!string.IsNullOrEmpty(player) && player != " ")
{
players[player]++;
if (player.Equals(previous))
players[player]++;
previous = player;
}
}
foreach (KeyValuePair<string, int> kvp in players)
{
Console.WriteLine($"Player: {kvp.Key} scored {kvp.Value} baskets");
}
}
}
You have not explained which test cases fail, or where the reported error occurs, so this may still be incomplete.