The problem you are experiencing is most likely because the import process is taking longer than 30s, which triggers a gateway timeout in our system. This is quite possible with larger courses if you are calling importCourse, as there is a lot that has to happen after the course is uploaded to our servers (e.g. scan for viruses, unzip and process the package, upload all of the content to s3, etc).
To prevent the gateway timeout from interfering with the import response, you can use importCourseAsyncwhich will return a token id after the course is uploaded and then asynchronously carry out the rest of the import process. Afterwards you can poll for status updates with getAsyncImportResult.
If you have any questions, just send a message to firstname.lastname@example.org