Thanks @Wiktor Bielakow for providing additional information and helping us get to the bottom of this issue.
We investigated and confirmed that this issue was caused by a bug. The APIM team is now actively working on this and we'll provide updates through this post as they become available.
UPDATE 11/10/23: The fix should be now deployed across most regions while there may still be some regions where it's yet to be available.
Please "Accept Answer" if the answer is helpful so that others in the community may benefit from your experience.