I cannot replicate the issue. So if the cause is the table join (although I don't understand why), perhaps your original expression in query would work if tblPersonnel is removed.
I determined the array variable and DateSerial are not necessary. DateDiff() recognizes "2017-09-09" string as a valid date.
Code:
Public Function Foo(InVal As Variant) As Integer
If Not IsNull(InVal) Then
Foo = DateDiff("d", Mid(InVal, InStrRev(InVal, " ") + 1, InStrRev(InVal, ".") - InStrRev(InVal, " ") - 1), Date())
End If
End Function