It has been pointed out in the comments that the economy doesn't have to collapse because there will still be immaterial properties and such, thus making your premise flawed. I want to address that briefly because I believe arguing how the economy can potentially "end" should be part of an answer ;).
I do not agree that the economy surviving is absolutely certain (especially since this is a fictional world with fantastic machines in which one can make stuff fit). I don't think that enough people value brand new or immaterial goods themselves enough to keep society going, especially given a certain end-of-resources tech level. But there is more entertainment, culture and art out there than one can consume in a lifetime already. I believe that especially given that we are in the far future where technological progress might have slowed down to a creep, you can assume that economy as we know it ends with the invention of those machines. If you do not want progress to stall, you can always make new inventions and so on public, a current trend that might lead to consequences in the future. But I also believe it is somewhat irrelevant, you can always define economics as whatever you wish.
I also want to briefly address infrastrucutre: You cannot duplicate a cellphone network, an airport or the internet, but you can make this a non-issue in your world. Given that you have super advanced tech, I believe it is more than reasonable to create a world where infrastructure doesn't have to be constantly maintained, for example because the satellites will work for another 100 years without anyone taking care of them and things like that. The slow breakdown of everything can help you get to the anarchy at the end even. How to do everything in detail goes way beyond the scope I want this answer to be in.
So we assume you are post competition, improvement and mechanisms to put things right on the market. So we assume that economics is already out the window. So let's talk about achieving anarchy. I don't know how many of those machines there are, but if they can replicate any object, they should be able to replicate themselves. And remember, we are not dealing with mathematical certainties here, the writer has to fill out the gaps. Now imagine three scenarios (of course there is an infinite amount of possible scenarios):
a) The communism approach. Someone claims they control all the machines and decides, of course with incomplete knowledge, what needs to be produced and what doesn't. The people there could be corrupt, idealistic or just incompetent. But no matter how competent, they will never be able to commission everything that is needed to keep society going. But Politicians are quick to act and slow to think, they might already have outlawed other possibilities of production. Well, it might be impossible to produce anyways because you are waiting for those resources. Create a shortage in vital medicamentation for example. This will lead to poverty and a "collapse" of the society, a strong black market and strong organized crime, at least long-term. If you want it fast and drastically, make the people in control of the machines even more incompetent and corrupt.
b) There are enough machines and the access is not restricted. Well, great. You've just eliminated any need for a community. Why would people still need go to school and learn about how to be good people? They can just replicate food. You can be a drunk and drug addict and still live in a flat filled with jewelry and eat only the finest foods. Why would anyone choose a social career? Why would anyone still wipe the behinds of the elderly or take your blood tests if they could sit at home and play playstation? Well, you could force them and go to option a) or directly obtain your goal: anarchy. There will be those that will still behave socially, but if you believe this will be the majority, well, that's good for you.
c) Create a super plague. People have stopped doing their homework because Pharma doesn't make any money anymore. And those idealists will love that, finally big pharma is dead and everything is free. If your machines can just replicate anything, as soon as a new medicament is on the market, it can and will be replicated, perhaps even by the government. This is already somewhat true, but in your society the boundaries for this are especially low while our current society tries to prevent that a little bit. So after a couple of years/decades in your copy-paste world, stuff has become immune. Have a plague of some kind wipe out civilization. Anarchy is way cooler anyways if you don't have 12 billion people sitting on top of each other but a bit of room to breathe.
Maybe one of those options gives you an idea. I don't think this is the time and place to elaborate them much more. A lot is story-based from here.