After many experiments, I have resolved the problem by renaming the function from fetchPrice to getPrice and now it works. I may never know what was wrong in the first place. Maybe a hidden error in the compiled code.
Thank you for all your advice. It helped me to try different solutions, and that's what counts.