It's pretty obvious:
You get the day of week, if Sunday, this is 0.
You substract 1 and end up with -1.
This is not a valid array index.
In PA the week starts with a Sunday and dayOfWeek() returns a number from 0 to 6.
Why is your array of weekdays different from this? You should avoid this.
You shouldn't simply substract from the return of dayOfWeek().
To get the day's name, the format string 'dddd' does the trick, as @wskinnermctc already mentioned.
If you need to know yesterday's day of week simply use
addDays(utcNow(), -1, 'dddd')
Returns Monday
If you need today's day of week, it's
utcNow('dddd')
Returns Tuesday
If you need this in a different language (maybe that's why you created the array), use formatDateTime() with a location string
formatDateTime(utcNow(), 'dddd', 'es-es')
Returns martes
If it's somethig different, just tell us 😉