somehow the page can not get any source code in css or js although they are in the public folder, it is in this one alone when I use the route without the id it loads normally
update: I used a function called asset and put each link in it and it worked but I still don't get why the problem occured
Probably because your css and js files are off the route folder but you are not specifying absolute route to load the assets.
In your browser, open dev tools and load the page. You might see failed requests for the css, and the path it is looking in is /products/css/your.css when it should be /css/your.css
You need to look at the layout file and the way you are linking to the files.