Line 1038 of your code:
for (int i = release.Length; i >= 0; i--)​

This is in the FreePrisoners method. The array 'release' starting at 0 and the .Length function will give the amount of items in the array (starting to count from 1). If you'd now use release[i] you'll get an index out of range error. Because it starts at the wrong value. You should change your line like this:

for (int i = release.Length - 1; i >= 0; i--)

or

for (int i = 0; i < release.Length; i++)

These two will give the result you want with this method!

Another way is to use the foreach function. But this will require to edit a little more of your code. Here would be an example of Line 1038 - 1049:

foreach (var player in release)
{
     BasePlayer inmate = null;
     IPlayer iPlayer = covalence.Players.FindPlayerById(player.Key.ToString());
     if (iPlayer != null && iPlayer.IsConnected)                        
          inmate = iPlayer.Object as BasePlayer;
                        
     if (inmate != null)
          FreeFromJail(inmate);

     else player.Value.releaseDate = 0;
}



EDIT #1: Added the example of I going up instead of down
EDIT #2: Added the foreach option