Script on nested fileds

hi all and sorry for my poor english .
I have an index with this mapping

"mappings":{

    "properties":{

        "_class":{

        "type": "text",

        "fields":{"keyword":{"type": "keyword", "ignore_above": 256 }}

        },

        "my":{

           "type": "keyword" 

        },

        "notifications":{

            "type": "nested",

            "properties":{

                "detail":{"type": "keyword"},

                "identifier":{"type": "keyword"},

                "modelType":{"type": "keyword"},

                "notificationDate":{    "type": "long"     } 

             }

    }

}

I'm creating a script on notificatioDate fields.
But when I do doc['notifications.notificationDate'].value , kibana says me 'Script not valid' with no reason specified

Consider that it 's searchable and aggragatable.

Here's a Stack Overflow post on using _source instead of doc in the script: elasticsearch - How to access nested property at script_fields on elastic 5.x - Stack Overflow