New York spent nearly $1 billion on a new solar-panel factory in Buffalo, hoping Elon Musk and Tesla would use it to transform the ...