I found the problem, for those who are interested:
After reinstalling MacOS and having the problem again I finally found what was causing this error. I had a library installed that was conflicting with TUIO. After deleting it, everything worked fine.
tl;dr: when one of your libraries is not working, try removing all other ones and see if it helps.