Thanks for posting your question on Justanswer.com, a global paid independent support site.My Name is***** your description, it seems the problem is related to a sensor which detects the papers, the sensor is a micro switch which is placed in the path of the paper. Now, as you are facing two problems at once , it means the switch is loose from its place and causing the tray problem.
This type of problem has become very common nowadays because most of the manufacturers are manufacturing the printer with low-quality parts, just to make the printer cheaper and the end user are facing this type of problem on a regular basis. You are lucky that the problem started within the warranty period, you can get the printer replaced from Canon free of cost.
If you try to repair the printer at home then, the warranty will be void and you will not get the replacement. If you still want to repair the printer at home then, let me know otherwise please remember to give a positive rating, as that is the only way I am compensated for my time and effort.