• So it turns out that in the 2 failing scenarios, the function is going through the full table before applying the WHERE clause, and failing on a row where first name or last name is null.

    In the working scenarios, the WHERE clause is applied first, and only one row is acted on.

    So am I to conclude that order does matter in the FROM clause?