There are problems playing actions that add adjustment layers. There is also a difference between how old versions Photoshop recorded Adding adjustments layers an newer versions of Photoshop record adding adjustment layers. Old versions recorded a single step that identifies the adjustment type and included adjustment types setting used. Newer versions of Photoshop record two steps the first make the adjustment layer type and the second step make the adjustment type layer adjustment.
There is a potential problem playing actions that add adjustment layers since CS4. In CS4 Adobe added the Adjustment palette panel in its Fly-out menu Adobe has two options that change Photoshop default behavior of how Adjustment layers are added. Actions, Scripts and Plugin can not query these option or set them. Therefore adjustment layers may be added differently then how the automation is designed to work if these options are changed from their Adobe Default settings.
However adjustment layers are not always added the way these options are set. If there is an active selection active when and adjustment layer is added Photoshop will add a layer mask. It make no difference how the option is set. A layer mask will be included when there is an active selection. Also If you record adding the adjustment layer using the menu layer>new adjustment layer>type And in the New Adjustment Layer dialog you check clip to previous layer the layer will always be added clipped it makes no difference how the option is set. The adjustment layer will be added clipped when the box is checked the option is recorded into the action step. So it is possible to record actions and write scripts the work a known was and can be changes after the adjustment layer is added. However the does not help old recorded or even new actions that were or are being recorded in a more natural way. It is best to just forget these options exist and lean them at the default setting. That way Photoshop behaves as it historically work. .