It gets stuck on Do until even when the file is checked back in. I am guessing it is because it does not know the file is checked back in. I have tried using 'Get file Properties' and 'Get Files (properties only)' as well with the same result. I am using this flow to update the file name in a document library after a new file has been created by a user by calling the SharePoint web services. The Flow will fail if the document was being edited by a user so I need a way to check for this and pause the flow until the user finishes editing the document.
Flow is a bit challenging to troubleshoot, as the UI doesn't show which step each item is from. So, your idea to do a get item in the loop is good, but I'll assume your do until "checked out" condition is using the checked out field from the original "when a file is created" step. (the get item doesn't update those values).
Instead, perhaps create a variable before the loop, and initialize it to the current value of checked out from the original trigger. Use the variable for the do until condition, and after the get item in the loop, set the value of the variable based on the result of the get item action.
Your flow is running until the file is checked out. Where inside the flow is your file being checked out? The flow will trigger whenever the file properties are modified. So, if you check in, the flow will get triggered and it will run keep on running. Now, to stop the flow you will think, I should check out since while should stop after check out (because your condition says checkout equals true). But that is not the case.
Every time you modify the properties, a new flow gets triggered. So the first running instance when file is checked in keeps on running the do while block.
Please re-analyze the requirement and re-create the logic and post a new question with your requirement if you need help.