You might think how this could happen when you can simply access the library and open items inside it but just unable to publish the form via InfoPath designer. This isn’t related to library or SharePoint configurations at all.
If you are running SPD on a Server operating system, one single feature called “Desktop Experience” could be missing there and installing that will solve this for you.
Resolution: Install Desktop Experience if you are opening SPD on a Windows Server
Open up Server manager and proceed to “Add Roles and Features” wizard. Under the User Interfaces and Infrastructure category, select Desktop Experience component and proceed to install it.
Close SharePoint Designer and Open again. You should be able to publish the form without any issue now.