OK, so the digit codes and the RD codes are not independent of each other as I thought.
I have a company with digit codes of, say, 01.01.01 and 20.20.20, and RD codes of R1, R5, R6, R9, R10, but according to the above it matters that the RD codes are connected to the digit codes.
I can't see anyway around this problem without writing a custom query solution, or going back to where we started, which is to make a hierarchical taxonomy that has the digit codes as the parent term and the RD codes as the child terms. But that means having to reproduce the RD codes for every digit code, which will not only be time-consuming to set up but will mean a messy UI when editing company posts.
The post relationship solution you proposed doesn't work because if your are querying (displaying) company posts then you can only filter by properties of companies and not by properties of something else. Filtering by the related posts (digit codes in your example) is possible because of some special handling for relationships within Views, but the RD codes in your setup belong to the intermediate post type used in the relationship, and not to companies, and so cannot be used to filter companies.
We will be adding support to filter by fields of related posts which would hopefully make it possible to filter by the fields of the intermediate posts, but I don't have a timetable for it, it is not imminent if you need it for a current project.
Sorry that it seems like we are going round in circles, but what you are trying to do is intrinsically difficult in the context of WordPress and the WP_Query class in particular which is what is used to retrieve posts from the database.
Right now your options would be to implement an entirely custom solution, or to use taxonomies and accept that once a user has chosen a digit code they may see RD codes that, if selected, will return no results.