The APIs signature states that it receives external_win_id as input -
EGLBoolean eglCompositorSwapPolicyEXT(EGLint external_win_id, EGLint policy);
While the API description itself mentions external_ref_id as input -
This function shall be called by the primary context to specify the handling of buffer swaps of the context specified by external_ref_id.