Landlording, when you don't know what you're doing, can be a nightmare, unless you get very, very lucky.
It's not something one can just naturally do, even though it seems straightforward. There's a lot to learn to do it right, and learning the things that can be done to avoid some of the issues you had is paramount.
Glad it ended up working out for you!