How to use to_regclass with uppercase table names?
Once you start using those dreaded double quotes, you have to use them always:

SELECT to_regclass('"FooBar"');


(another good example why you should avoid those dreaded quoted identifiers)