Hello @LLYC.1 and welcome to the STM32 Community :)
The max descriptor size is 255. This is specific to the USB protocol.
Imen
In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
I notice the comment is incorrect. At first I thought this is to increase the size of the IN/OUT Endpoint but is is actually increasing the size of the descriptor. And the generated code is incorrect. It still left at 2.