Once a RUM session/user action property key is deleted, Dynatrace keeps it reserved while historical data referring to that property still exists. Therefore, the same key can’t be recreated immediately.
Waiting for the historical data retention period to expire should make the key reusable again
If you need the property immediately, the practical workaround would be to use a different key, for example environment or app.env
If waiting isn’t an option, it may also be worth opening a Dynatrace support ticket to confirm whether the deleted key can be cleared manually for your environment.