Yes, your approach looks correct. Note that:
loss = loss_B + loss_C
loss.backward()

would accumulate the gradients in block_A, since both forward passes used the parameters in it. I assume that fits your use case and is expected.