You are only importing custom_fwd in the second approach, while you would need to import custom_fwd and custom_bwd.
Also, in your first example you are using custom_fwd twice, so you might want to change it as well.