I went through something similar with my smallest female normal... but it was a move from her 20long to a TUB that did it. She Hated that tub and wouldn't touch food the whole time she was in it. Now she's back in her 20long tank and eating regularly again...unless of course I offer her a mouse that's even a little 'too big' by her standards. I think this snake is destined to be small...she won't take anything over a small adult mouse. But she's eating.

A 40 is way too much space for any BP but a large female. I wouldn't even put a big girl in a 40, I would prefer a 30 breeder.
I suggest putting your snake back into the familiar 20g, give him the week to re-settle, and feed INSIDE the tank. That way, you're minimizing stress factors as much as you can. Then, just give him time and he'll eat for you again before long. If not, then look elsewhere for the cause since the housing is 'stable'.