Does this happen with videos from specific YouTube channels? If so, it is possible that your account has been blocked from commenting on their videos.
If you're unable to post comments, no matter the video creator, check that Restricted Mode isn't enabled for your account. Click on your profile picture and make sure the mode is set to Off. If it is set to On, click on it and disable Activate Restricted Mode.