Well, 40’s is absolutely not a problem. I’ve heard of men in their 60’s going to seminary. I heard of one man in his 70’s that was ordained, although I suspect that was an exception to the rule.
With regard to debt, that could be a problem (small credit card type balances notwithstanding). If you’re up to your neck in debt, then you need to deal with that first. Don’t want to be distracted in seminary, you know?
You want to be very careful which diocese you sign up with, though. Some are really bad. I’ve heard horror stories from priests. Fr. John Corapi tried in his home diocese, and the guy in charge of vocations talked to him for about three hours about how the bishop would never ordain a man who wasn’t in favor of women’s ordination, acceptance of homosexual acts, and a bunch of other stuff that’s against Church teaching. He went to another diocese and got in. While there, someone found a letter in his file from the guy in his home diocese. It said some horrible things about him that were absolutely untrue, said he was unfit for the priesthood, etc. So, he asked the assistant dean (or whatever his title was) about it. The asst. dean said, "Oh, yeah! That letter was the talk of the town! We were sitting down to select the next year’s class and yours came up. Someone said, “Ut oh! We have a problem letter here.” So, the head guy asked him to read it aloud, which he did. There was dead silence. Then, the head guy asked, “What diocese was that from again?” And the guy that read it told him. The head guy picked up his gavel, slammed it down and said, “Accepted! Our kind of man!” LOL