I think it is too tight as the flight should arrive at Terminal A.
If you could go up to terminal T and clear immigration from Schengen zone and go take a bus to Terminal B (provided that you do not wait for the bus), it may be possible.
However, extra security check-in counter (where they ask you questions about your luggage and your immigration status) for your US bound flight may close before you manage to get to the Terminal B.
Overall, I think it is too tight.
I know this is not the case for you but if you are coming from the US and transfer to non-schengen countries (pier B transit), you do not need to clear security and I am confident that it is quite possible with 40 minutes.