Hi Marc,
Thanks for your informative post.
I encountered the same Error Code 504. with my TREK RAIL 7, with Bosch 2020 (Gen 4) Performance CX motor, running an up-sized 38T front chain ring.
I had SpeedBox2 installed, with Aug/2019 firmware installed to cater for 2020 Gen-4 motor.
The bike...