The AC compressor doesn't work if the engine is off, since it is powered by the engine's crankshaft pulley/belts. All AC are like that.

Only the fan (electric-driven) works when the engine is off.