1 )
Both schematics are correct.
A phototransistor is used that way.
But a IR photodiode is used in reverse (blocking) to sense IR waves.
I think that is called "reverse bias".
2 )
There can be so many things, the sensor might still work.
Do you use a breadboard ? those can have bad contact.
Can you try another analog input ?
Perhaps you don't have the flame sensor, but perhaps something else like a IR led. Or your sketch might be wrong.
It is hard to say what to do without knowing the type of sensor.