Excess roth 401k contribution with filing extension

I am working on my 2023 taxes and noticed that I over contributed above the roth 401k limit. I was missing a tax form and couldn't file by the deadline, so I submitted an extension.

 

Because I submitted an extension that gives me until October 15th to file, can I avoid being penalized on my roth 401k excess contributions if I take out the excess by that date?

 

I use Fidelity. What is the process for having them return the excess contributions for me? And will they automatically issue me a 1099-R for next year's taxes? Again, this is for excess roth 401k contributions.