After reading your post, I wanted to ask this:
Cant the courts order the contested states to throw out and not count ballots submitted after the polls closed?
Absolutely. In some states the courts have already permitted the states to count these ballots but ordered them to be counted separately in anticipation of legal challenges. If these ballots were accepted in violation of state law they can legitimately be excluded from the counts.