After check, I reproduced this issue and raised it internally to CubeMx team for fix.
Thanks for bringing this to our attention.
Kind Regards,
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