Hello,
If you turn the computer off will it continue to charge? If it still won't charge even when the computer is off, this is not a Windows issue, but a hardware issue.
You can use this instruction: https://support.microsoft.com/windows/caring-for-your-battery-in-windows-2db3e37f-5e7d-488e-9086-ed15320519e4
Find the heading "Get a detailed battery report in Windows 11" . Follow the instruction and create a battery report. Share via OneDrive link with me.