The cause was determined by some WordPress wizard to be related to an obscure runtime configuration setting in the PHP interpreter, specifically the one called ‘pcre.backtrack_limit’. Increasing this 10-fold from the deafult value of 1e5 by a line like
ini_set('pcre.backtrack_limit', 1000000);
in the initialisation code of the plugin made the bug disappear.