In other Welsh names I've seen, where there are two names before the "ap", the first one would appear to be the given name and the second one a nickname, like "George the Bald" "Gruffudd the Somber". I'm pretty sure the second name thus was achieved later in life and was not part of the birth name. So whatever you see, I would put it as a nickname rather than as a middle name. (Then if you discover it's wrong, it's easy to change.)