Hi @frambroise
welcome to the arduino forum.
As an analogon:
Info to you: my hair is blond and my trousers are black.
My question to you: "What is the date of my birth?"
Of course you can't tell from this too small base of information.
How should anybody analyse what the reason is if you don't provide enough information?
Post your complete sketch with which you tried to connect to your WiFi using this method
best regards Stefan