CustomData_get_active_layer_index() was used by accident. But that returns the CustomData layer index (in all layers) as opposed to CustomData_get_active_layer(), which returns the active UV layer. Pull Request: https://projects.blender.org/blender/blender/pulls/106644