Embedded font not visible

I stumble upon some problems with Flash IDE’s font embedding, so I gave it a try and went full AS3:

        function configureTextField(field:TextField, color:uint = 0x0099FF, size:int = 16) {
			field.scaleX = field.scaleY = 1
			field.defaultTextFormat = new TextFormat((new DefaultFont()).fontName, size, color, true, null, null, null, null, null, "center")
			field.embedFonts = true
			field.antiAliasType = AntiAliasType.ADVANCED


        var fields:Array = [txtUser, txtPassword, txtName]
		for each (var field:TextField in fields) {
			configureTextField(field, 0x666666)

“DefaultFont” being a library symbol of a proper font.

Problem is, this function only works in half the fields I pass to it, randomly. When it “fails”, the field seems empty (even when it’s not) and if it’s an input one it’s not possible to even place the text cursor in it.

No error, no warning and the fields are exact copies of the other with different instance names.

In the example above “txtPassword” worked but not “txtUser”.

What could it be?