I have used this type of extender and they work pretty well. I think that they are allowed and are one of the few ways out of the issue of having a box set too far back. When I first started the only extenders were sheet metal, they also worked well the biggest problem I had with those is that the metal ended up very close to the energized screws so I always taped the device. You are correct the best solution is to have properly installed boxes but I for one don’t live in a perfect world.