System.InvalidCastException

Below is the code I am using I am attempting to see issues where validations failed and be alerted not just that the test does not finish:
IReadOnlyList allTextViewElements =
(IReadOnlyList)_IOSdriver.FindElementByAccessibilityId(“AddressCC”);
if ((allTextViewElements.Count > 0))
{
((IJavaScriptExecutor)_IOSdriver).ExecuteScript(“stack_executor: {“action”: “setSessionStatus”, “arguments”: {“status”:“passed”, “reason”: " Results found! “}}”);
}
else
{
((IJavaScriptExecutor)_IOSdriver).ExecuteScript(“stack_executor: {“action”: “setSessionStatus”, “arguments”: {“status”:“failed”, “reason”: " Results not found!”}}”);
}
_IOSdriver.Quit();

}