do_action doesn’t trigger if it’s in a template that gets loaded via REST endpoint

do_action doesn’t trigger if it’s in a template that gets loaded via REST endpoint

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)