Unfortunately is not matter of ‘Focus’ since: 1) is not active; and 2) I do get notifications if I invoke Display Notifications from the Script Debugger. But I do not get any notification when I run the same command from Terminal.
Any other idea?
Then execute the command again in the Script Editor (not Script Debugger) and see if the notification is displayed. If not, then check the notification setting of the Script Editor. It seems that osascript is running in its context and there are separate settings for notifications for each app.
Otherwise you could try the following again:
osascript <<EOF
display notification "Hello from me" with title "Hello"
delay .5
EOF