When I was trying to record using XBox Gamin bar, the ‘record’ option was disabled.
So I tried uninstalling it using Powershell in admin mode and entered the following command
get-appxpackage *Microsoft.XboxGamingOverlay* | remove-appxpackage

Then went to Microsoft store to install the ‘XBox Game bar’ again and now the record option is visible.
Hope it helps.
*This post is locked for comments