This looks working as a workaround, however, this approach has some donwside that:

Features could move from EE to FOSS or vice versa. Therefore, the offset might be mixed between FOSS and EE in the future.
e.g. When you move activity_limit_exceeded to FOSS, you'll see { unknown_failure: 0, config_error: 1, activity_limit_exceeded: 1_000 }.

The integer column for the enum is likely created as SMALLINT.
Therefore, you need to be careful of that the offset doesn't exceed the maximum value of 2 bytes integer.

As a conclusion, you should define all of the key/value pairs in FOSS.
For example, you can simply write the following code in the above case: