I have written a bot that works >90% of the time, but I keep getting an error and I need help. The bot executes two queries using Microsoft Access and then compares the output to see if the results are the same. It compares the exported datatables on several dimensions including if the headers match, the number of rows match, the number of columns match, and the body of the queries match. However, the problem I'm having is that sometimes when comparing the body of the query, I get an "Object reference not set to an instance of any object" error. The query then quits and won't continue to execute.
The problem is that the two variables holding the results don't match, but then the query should just not trigger the IF statement and continue executing. I can't figure out why I'm getting the "object reference" error sometime (but not all the time). Here are screenshots:
Screenshot 1: shows the if statement that compares the two variables and the error (full error message pasted after the image).

Full error message:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Comparison.ComparisonCalculator.GenerateCalculatorKey(Type leftType, Type rightType, Type actualLeftType, Type actualRightType, Boolean& avoidTypeChecking)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Calculators.DataTableCalculator.Compare(Object left, Object right)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Calculators.DataTableCalculator.CompareDataTables(DataTable left, DataTable right)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Calculators.DataTableCalculator.EqualTo(DataTable left, DataTable right)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Calculators.CalculatorBase`1.ExecuteComparison(Object left, Object right, Func`3 comparisonMethod, Boolean& useNextCalculator)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Calculators.CalculatorBase`1.CompareImpl(Object left, ComparisonOperator operator, Object right, Boolean avoidTypeChecking)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Comparison.ComparisonCalculator.GetCalculatorAndCompare(Object left, ComparisonOperator operator, Object right, String calculatorKey, Boolean avoidTypeChecking)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Operators.Comparison.ComparisonCalculator.Compare(IRuntimeErrorHandler errorHandler, IContext context, Object left, ComparisonOperator operator, Object right)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ExpressionEvaluator.Visit(ComparisonExpression comparison)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ExpressionEvaluator.EvaluateAndCacheExpression(IEvaluatableContext expression)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Visit(IIfStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.ExecuteStatementWithException(IStatementWithException statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Execute(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Visit(IfScope scope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Execute(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.<>c__DisplayClass100_0.<ExecuteScope>g__ExecuteStatement|0(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.ExecuteScope(IScope scope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.ExecuteLoop(LoopBaseScope loopScope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Visit(LoopScope scope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Execute(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.<>c__DisplayClass100_0.<ExecuteScope>g__ExecuteStatement|0(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.ExecuteScope(IScope scope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.ExecuteLoop(LoopBaseScope loopScope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Visit(LoopScope scope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Execute(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.<>c__DisplayClass100_0.<ExecuteScope>g__ExecuteStatement|0(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.ExecuteScope(IScope scope)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.StatementExecutionHandler.Execute(IStatement statement)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.Runner.Run(Program program, RunMode mode, ProcessArgument[] arguments, DebugInfo debugInfo)
Screenshot 2: shows the data in the QSolutionDataFull variable (so this variable is not null)

Screenshot 3: shows the data in the QSSolutionDataFull variable (so this variable is not null)

So clearly the results don't match, but why does the bot throw the error instead of just skip the if statement? How can I fix it so the bot continues to run?
I have tried the following (or ruled the following out) already:
1. I can replicate the same error using different SQL queries (so it is not just one query)
2. I verified the variables are both of the same data type (see image, they are both datatables) and the SQL executes (my code weeds out queries that don't work earlier in the process).
3. I have verified that it works when the datatables match.
4. I have verified that it works most of the time when the datatables don't match.
5. I have changed the inequality with the same result
6. I have tried to search and find the problem in the forums and on the internet with no luck.
I would appreciate any help!