If they want to fail you right away, perhaps, they would have not asked you to send them a complete solution after the interview.
As they ask you to submit a solution after the interview, it could be that your approach is so new and interesting to them, and they simply want to see if it actually works. If your final solution is significantly better than theirs (for example: yours has better time and space complexity), then they will appreciate yours very much, and that may help to move you to the next round of interviews.
Please note that, for live coding interviews, sometimes, the interviewers could extend the interviews for another 10 or 15 minutes at the end to see if the candidates can solve the problems (especially when the candidates are doing pretty well during the interview) .
So, you should wait and see what their reply to your solution is.
In data structures and algorithms, there may always be fun, exciting, and more efficient solutions that people are not aware of. :-)
Another scenario is that the interviewer wanted to end the interview sharply at the end as you both ran out of time because he may have another interview lined up with another candidate, or a big important meeting with his boss. So, he had to end your interview at that point. But, he wanted to give you some extra time to submit a complete solution for him to review as he may like your strategy to solve this problem.
Or, it could be that the interviewer may simply want to be polite and asked you to submit the complete solution for your interview record.
We don't know exactly what the interviewer was thinking.
In the meantime, perhaps, you should simply enjoy those interviews and learn something positive from them. For every passed or failed interview, you can always learn something from it to prepare for future interviews. If you don't get a job with this company, there are always other companies to look forward to. Keep applying for new jobs.