Not sure if I'm missing something, but why not just extend the WHERE clause in the CTE with:
AND InLoc NOT IN ('Bike Barrier Enter', 'Flap Barrier Enter 2')
As for the "Access Denied" error, it may be that your query text is somehow trapped by a spam filter (please don't ask why). But you could attach the query in a file. (But if my Answer helps you, I don't think there is a need to do this.)