Hi everyone,
I have exhausted all avenues, so would be very grateful for your help. I am new to Flow, so please excuse me if I sound ignorant. So far I have progressed with the information I have found on forums, so thank you.
I am wanting to check whether a file is checked-in or out, and based on the answer check it in or out accordingly. If it is checked-in, then check it out and vice versa. It's a development stage for me to understand how this works.
I have managed to get as far as testing whether the file is Checked-in or Checked-out and the condition returns the correct answer. I have set up flow to email me the result of the condition, but the condition doesn't follow the appropriate branch.
So to test it I have a file which is checked-out to me in SP. Confirmed.

When I test the flow it send me the email (Send an email 3) confirming the file is Checked-out

Email received
The flow from the condition 5 is as follows

Now when I test this flow I expect the result of the condition will mean the 'Yes' branch will be followed, because the file is already checked-out, so I want it to be Checked-in. But I receive an error and find the test has gone down the 'No' branch. Inspecting the results of the test the error occurs in the Send an HTTP request to Check-out document step, it states the file is already checked-out.

So I seem to be missing something here. I have tested the IsCheckedOut property, which determined it is. I don't understand why the condition is failing as it is also interrogating the same.
Interestingly, I changed the condition from "is equal to" to "is not equal to" and the flow worked. This defies logic to me, but I must be not considering something because the file is checked out. 
Resulting flow test

But it only works once, now the file is Checked-in and I try running it again. The file is confirmed Checked-in in the email, but the condition goes down the 'Yes' branch and then gives me an error "the file is already checked-in". I expected it to go down teh 'No' branch.
Any assistance will be greatly appreciated. Apologies this is so long, but I really wanted to make sure I was articulating the problem properly.
Kind regards,
Russel