Doubt with the halting problem undecidable proof
The main problem with your analogy is the construction of Diag. The usual proof goes as follow:


Assume Ends exists.
Then we can construct Diag with a Turing machine calling Ends. As follows:


Diag(P) = If Ends(P,P) then Loop indefinitely Else Terminates.


This leads to a contradiction thus Ends does not exist.


What you are doing is the following:

1'. Construct Ends(P,I,S).

2'. Construct Diag(P,S).

3'. This leads to a contradiction.

The main problem is that you do not provide the actual construction of Diag in step 2' as we did it in step 2. How can you implement Diag with a TM machine calling Ends? I do not think so as you need more than S steps to run the program Ends.