The contribution periods for 2023 were March 2, 2023 to December 31, 2023 and January 1, 2024 to February 29, 2024. So if you made a contribution at the time of your withdrawal on March 9th, then the contribution would be included on your 2023 return.
To make a repayment under the HBP, you have to make contributions to your RRSPs, PRPPs, or SPP in the year the repayment is due or in the first 60 days of the year after. So if you made contributions that went on your 2022 return (prior to March 2, 2023), then they don't count for HBP repayments that you have to make for 2023.