Refresh spell bug

I’m trying to cast refresh on a party member that was afflicted with sleep by a nightmare golem and it doesn’t let me cast it.