There are actually a lot of possibilities to achieve what you want.
First one is to override your New button for Object B.
You need to add to your aura component this interface:
probably with some other ones like
Next you can go to Object B Object Manager -> Buttons, Links, and Actions ...
It looks like you have added this button on Home Page and it's not having any value in 'this.recordId' basically, And so is the reason the error.I was able to reproduce this on home page at my end. If you add the same button on account page, this should work smoothly.