TimeoutError shadows a builtin exception with the same name, which leads to confusion
try:
page.click("foo")
except TimeoutError: # builtins.TimeoutError
# this doesn't run because it raises a playwright.sync_api.TimeoutError
print("failed to click element")