Flags cannot be deleted immediately after creation

I observed on a fresh sandbox instance using 3.6.0.beta2-latest that if I create a flag, then it cannot be deleted. I see the following tooltip, even though I’m the only instance user and I just created the flag.

On a somewhat related note, I am confused about flags API. It seems that unlike with all other settings that are returned via a JSON, flags are returned as data inside a div in the HTML response. Is there a way to configure flags programmatically?