add_action outside a plugin

You add your _setup function to wp_head without priority, so it’s given priority of 20. All of the actions you are trying to remove within that function either have a higher priority (lower number), or same priority but are already in the queue ahead of yours, so when your _setup function runs, they’ve already sent their output. There’s no reason to wait until wp_head to remove those actions, you can do it on the init action.

Also FYI, all your file needs is a plugin header and it’ll be a stand-alone plugin.

error code: 521