This is a replacement cup holder for lap desks such as this one https://www.amazon.co.uk/gp/product/B095KLCY4B/
It has a twist locking mechanism to stop it falling out.
The author marked this model as their own original creation.