Hi @Marija Zorić ,
This error may be caused by that the limitation data connection response size. The limitation data connection response size is set to 1500kb for Form Services by default in SharePoint online. In SharePoint on-premise we can set this limitation in Central Administration but in SharePoint online we are not able to change this limitation. You could remove the unnecessary fields to pull less data. And you could try to use Power Apps forms instead of Infopath forms. Microsoft Power Apps Community
For Reference: InfoPath Forms Services differences between SharePoint Online (DvNext/MT) and SharePoint On-Premises
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.