STMicro library for setting RTC Alarm on Sunday is incorrect?
It is a common situation where the Day-Of-Week is represented as a value of 1 -> 7. You can also find situations where the DOW is represented by numbers 0 -> 6. 

I have also seen situations where sometimes Sunday is considered the first day of the week with the lowest DOW number and others where Sunday is considered the last day of the week with the highest numbered DOW number.  

You have to do whatever it takes to adapt your application environment to the DOW number system used in your RTC chip. If that takes a little software coding on your part then that just becomes a part of the job.

So I would recommend that it is better to track toward what works instead of trying to figure out what may or may not be wrong with chipset library code.