Finally got this animation on iOS Safari to work. It seems like Mobile Safari prevents JavaScript to focus elements asynchronously. It makes sense actually. Without that limitation the web would be pretty annoying on iPhones because the keyboard would pop up all the time. Although this limitation is bad for what I had in mind, I was able to build around it for this project picker thing. iOS allows to focus input elements after the user clicks a button. So I added a listener that would focus the input after the user clicks the "Add Project" button. I still don't know why, but this resulted in the weird glitches I was showing in the videos before. Good thing I found out that iOS indeed lets you focus input elements asynchronously if another input element is already focused.
The final solution now is to have a fake input element that is not visible and gets focused right after the user clicks the "Add Project" button. After the animation is finished the actual input element gets focused.