Arguably, if it's optimistic, it isn't "punk." That "low-life" alienation and rage against the system is what makes it punk - the "cyber" part is just aesthetic.
Anticapitalism isn't punk in a world where the anticapitalists win.
This is just my headcanon but I think of the punk in solarpunk as being metatextual: it's not rebelling against its own world, it's rebelling against ours, and against the pervasive pessimism of capitalist realism. I think we need something like that in a time where most fictional futures are dystopian.
Cyberpunk is nothing if not a rebellion against our own world and status quo. Liberal governments are put under the thumb of for-profit corporations, which continue to develop and unleash new technologies on the public without any thought given to the social consequences or any check from the government. At the same time, the inexorable march of technology empowers authoritarian governments and those who rebel are pushed into the sidelines to become social outcasts. Cyberpunk asks us to consider what happens if social development doesn't keep pace with technological development sprinting forward at breakneck speed. Believing social development will keep pace with technology is the essence of solarpunk. Solarpunk is a lullaby.
Solarpunk isn't about believing that social development will keep pace with technological development, it's about imagining what would happen if it did. Its politics are not a fairytale but a call to action to divert course. Cyberpunk says "the future is just gonna be awful" and explores just how awful it's going to be (which isn't rebellion, it's apathy), solarpunk says "imagine what the future could be like if we made it better". It's only a lullaby if you believe there's no hope for change.
Cyberpunk is a call to action: seek social reform before this happens. Solarpunk is the opposite, Solarpunk encourages people to believe that everything will turn out well in the end after green technology saves us from our past follies.