Say I want to create a programming language with some name, but there already exists another programming language with the same name. Could I get in trouble (legal or otherwise) if I create another programming language with this same name?
It would not be a copyright. Names and short phrases are not subject to copyright, but it could be a trademark under common law ( e.g. state law in the U.S.) or could be registered.
Some people think a trademark defines a product. That is not the case, a trademark identifies the source of a product or service.
Programming language names are not copyrighted - they are much too short for that.
Some programming language names are protected by a Trademark. For example, Apple Inc. holds the trademark for "Swift". I am quite sure that Java is protected in a way that you cannot call a language Java that doesn't match the definition of the "real" Java.
The biggest problem is that if you sell let's say a compiler for the FORTRAN language to me, and it doesn't compile the language that I know as FORTRAN, then I will sue you for damages and the judge will throw your excuse that finding a "cool, unique" name is hard out of the court.
The designer Raymond Loewy was hired by a company as an expert witness: Their competitor had copied the design of their product and claimed that it was impossible to find a different design and get the same functionality. Loewy arrived at the court a few days later with three totally different designs.