This would check out at companies where you could “coast” without any oversight and were just randomly estimating some “points” on your “stories” or whatever BS process is in place.
On real projects and real teams you can’t do this. If you did what you did in your example you’d say log 8hrs of work, right? Your team lead will ask a simple question: “did you write this code or was it AI-assisted? and what exactly here took 8hrs?” so you could do this once and 2nd time you’d be changing the status on linkedin to looking for work