Hi Alvaro,
This appears to be a bug with the Retail Rate battery dispatch option that we fixed for the next update to SAM 2023.12.17, which we plan to release in early July 2024. My colleagues are investigating, and I will follow up when I hear from them.
The way the demand charge rates are set up in the file you attached, there are no demand charges, so I think you can work around the bug by disabling the demand charges.
Best regards,
Paul.