BEIJING—The growing unease toward foreigners in Beijing nearly claimed an unexpected casualty: a community theater production of "Oklahoma!"

Just an hour before the curtain was to go up on opening night May 18, a cast of foreign and local thespians were told that Beijing authorities wouldn't allow their performance of the 1943 musical about two cowboys in love with a pair of farm girls.

Authorities...