Your diagram is correct, personally I prefer to connect B5+ of the BMS to B5+ of the battery but it’s the same in the end.
There are 10s BMS with 11 balance leads as well so B0- is the first cable of your balance connector of the first battery (standard on any battery). Your BMS has 10 balance leads and needs no connection of B0- so all good.
Now the bad news, your BMS is NOT for discharge, it would shut off at 40A so it’s more a 20A BMS in reality. You could use it for charge only or you need to buy a bigger BMS like 60A (which normally cuts off at about 120A). It is shady to sell a 40A BMS with 40A over current and 40A short circuit protection.
I created a previous post a few weeks earlier asking if my setup was OK. They replied saying my dual hub motors pull 15a max, in addition esc draws 12a for each motor so probably wont even go over 30a.
Here are the links to motor and esc which connects to esc incase you like to check: