I've seen Claude do similar stuff in code. I asked it to add a new API endpoint in a project. I specified it should use rx.java flowables as the framework I'm using has built in support. I specified to use micronaut data for the database connection.

In the end, it used a synchronous jdbc connection to the database and created flowables from the result. Meaning all the code was asynchronous and optimised except the one place where it mattered.

Took me about 3.5 seconds to fix though, so no biggie.