Implement a range behaviour in Python using iterators
You have an iterator
Your code implements an iterator, you are right. You have defined a __next__ method and it works well.
I would tweak your code slightly, though:

remove the check because iterators can be empty and that is okay;
fix minor spacing issues around operators, etc;
use augmented assignment to increment;
change order of statements in __next__ to be more idiomatic.

All in all, MyRange would end up looking like this:
class MyRange():
    def __init__(self,data):
        self.data = data
        self.index = -1
            
    def __iter__(self):
        return self
    
    def __next__(self):
        self.index += 1
        if self.index == len(self.data):
            raise StopIteration
        return self.data[self.index]

In particular, the changes to __next__ are because you start by setting self.index to the value of the index you would like to read. Then, just before reading the value from data, you ensure you can actually use that index and raise StopIteration if you can't.
range is not any iterator
However, the &quot;problem statement&quot; says to implement an iterator that behaves like range, and as brought to your attention in the comments, range is a very specific iterator that can take up to 3 arguments: start, stop, and step.
Take a look at the docs for the range function here.
Having said that, solving this &quot;issue&quot; does not need to be very difficult.
You could do something as simple as having my_range take the three arguments,
generate the data you need, and then feed it into MyRange to iterate, but that seems like a waste.
What I think is more or less the intended approach, is to define MyRange to expect the start, stop, and step values, and the my_range function is what the user calls, which then fills in the start, stop, and step values that are used by default and calls MyRange.
E.g.,

my_range(10) would call MyRange(0, 10, 1);
my_range(4, 12) would call MyRange(4, 12, 1);
my_range(0, 13, -3) would call MyRange(0, 13, -3).

(In the examples above, I assumed you changed MyRange to do what I described.)
Therefore, just for the sake of clarity: what would be happening is that the __next__ method would use the three arguments start, stop, and step (and possibly other auxiliary variables you create) to compute the successive values, instead of generating all of them at once and then returning one by one.