No, you can't take a credit for the solar panels this year, the expenses must be used towards a credit originating in the year they were installed. For 2024, per Who Can Take the Credits you may be able to take the credit if you made improvements to your home located in the US in 2024.
There is still time for you to amend your 2022 tax return and take the credit for the 2022 tax year.
See: How do I amend my federal tax return for a prior year?