From my own testing, I experience similar as raised by @nktrin . By default, the Managed gateway is associated with an API. In the Management Plane UI, it is possible to remove the Managed gateway from an API. However, I am unable to find any Bicep/Arm support for removing the default Managed gateway association on an API.
The Rest API delete and create-or-update explicitly mention that they can not be called for gateway id 'managed'. However, tests show that this is not the case and this is one way to remove the Managed gateway association to an API. It is therefore not clear if the documentation is wrong or the behavior is unintended.
Is this a deliberate limitation on APIM or can you provide official guidance on how to remove the Managed gateway on an API in code?