Why when pinging a remote server time is 40 ms, and when you do a trace, the amount of time on each node is much more than ping!
Because when tracing, normal ICMP (ping) is sent to the host first, while TTL = 1, respectively, the nearest your router will send you a return response that TTL is too small and you will not reach the addressee. Actually, this is considered the time from request to reply. Then the TTL is increased by 1 and the second router will send you the answer, and it takes even longer. And so on, while with an increase in TTL you do not reach your host and the total response time will be = the sum of the response time to each of the routers, and the last response time (when they reached the host) will be approximately equal to normal ping.
Because when you ping a remote node, your packet goes through the "tunnel" and is considered as normal traffic by them. In the case of a trasert, your packets pass through a line of routers (this is indicated by the fact that you cannot ping some nodes along the route). Then just a quote from Wikipedia:
Due to the nature of the routing protocols on the Internet, the return routes often do not coincide with the direct ones, and this is true for all intermediate nodes in the trace. Therefore, the ICMP response from each intermediate node can go its own route, get lost or come with a long delay, although in reality with packets that are addressed to the end node, this does not happen. In addition, intermediate routers often have a limit on the number of ICMP responses per unit of time, which leads to false losses.